Inline-Toolbar & Side-Toolbar configuration options
See original GitHub issueHello,
In the docs, there a comment about creating a toolbar instance, and that you can pass in a config object. Can you clarify what this config object looks like? Also, Can I pass in custom buttons?
// Creates an Instance. At this step, a configuration object can be passed in
// as an argument.
const sideToolbarPlugin = createSideToolbarPlugin();
Thank you,
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Options for customizing the editor's toolbars - TinyMCE
To specify multiple toolbars, the toolbar option should be provided with an array of space separated strings. Type: Array. Example: adding multiple toolbars....
Read more >Toolbar Configurator - CKEditor
Show empty toolbar groups. Add row separator. Select config. Back to configurator. Get toolbar config. Toolbars. Toolbar groups. Toolbar group items.
Read more >Inline Toolbar - DraftJS Plugins
In this editor a toolbar shows up once you select part of the text …
Read more >Inline Toolbar with Selection - Froala
Enabling the toolbarVisibleWithoutSelection option makes the inline WYSIWYG HTML editor to appear as soon as you click in the editable area.
Read more >Enable Inline Toolbar - Editor.js
Note. Names of Tools in inlineToolbar is the keys of Inline Tools plugins that used in tools property of initial config. There are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Alex-ray Hmm, true!
I can only see that solved through React’s context at this point, which is maybe similar to your current workaround. But currently you’re restricted to a fixed number of buttons anyway. With PR #729 you’d be able to change the buttons at run time, but you’d still be dependent on a special system like React context or pub/sub or so if you want to change them from the outside, as you can not use regular props.
Currently the
Toolbarcomponent is exported already pre-populated with the necessary props. Maybe it would make sense to use a different HOC there that only sets the predefined props if they are not already present – e.g.decorateComponentWithDefaultProps.Therefore
<SideToolbar />would still render the way it does currently, but it would allow for<SideToolbar structure={[DynamicButton1, DynamicButton2]} />to be rendered next to the editor.Not sure if this is the best way though. Maybe @nikgraf has more insights.
@Alex-ray Can you provide a use case for the prop you want to pass to the structure? Chances are this is already possible.
E.g. you can do:
There’s also a package called decorate-component-with-props on npm that helps with this use case.