Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to allow grouping of actions into a dropdown in toolbar #354

Open
dkyeremeh opened this issue Mar 27, 2024 · 0 comments
Open

Feature to allow grouping of actions into a dropdown in toolbar #354

dkyeremeh opened this issue Mar 27, 2024 · 0 comments

Comments

@dkyeremeh
Copy link

dkyeremeh commented Mar 27, 2024

Summary

It would be great if this plugin allows toolbar actions to be grouped into a dropdown. This will allow devs to create compact toolbars when a lot of actions need to be defined.

Motivation

As it stands now having more than a few actions in the toolbar easily causes clutter. This limits the number of actions that can be used.

In the screenshot below, the icons for the headers and paragraph are almost occupying the entire toolbar. By implementing grouping, this can be reduced to a single dropdown item.
Screenshot 2024-03-27 at 9 40 18 AM

Implementation

I can get this feature developed if it seems good to you. I would also need your input concerning the prop structure to use.

For now I think we can use a 2 dimension array for the value of the action prop of RichToolbar. The icon for the first item of the array can be used.

Example

<RichToolbar
  editor={ref}
  actions={[
    actions.undo,
    actions.redo,
    [
      actions.heading1,
      actions.heading2,
      actions.heading3,
      actions.heading4,
      actions.heading5,
      actions.heading6,
      actions.setParagraph,
    ],
    actions.setBold,
    actions.setItalic,
    actions.setUnderline,
    actions.setStrikethrough,
    [actions.insertBulletsList, actions.insertOrderedList],
    [actions.insertVideo, actions.insertImage, actions.insertHTML],
    actions.insertLink,
    actions.keyboard,
  ]}
  ...
/>;
@dkyeremeh dkyeremeh changed the title Feature to allow grouping of actions in toolbar Feature to allow grouping of actions into dropdown in toolbar Mar 27, 2024
@dkyeremeh dkyeremeh changed the title Feature to allow grouping of actions into dropdown in toolbar Feature to allow grouping of actions into a dropdown in toolbar Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant