React-draft-wysiwyg: How to remove icons from toolbar?

Created on 18 Apr 2017  路  4Comments  路  Source: jpuri/react-draft-wysiwyg

Hello.
Thanks for your grate component!

I have an question.
I want to know how to remove icons which are not needed from toolbar.

In my page, I don't need 'emoji' in toolbar like below image.
customtoolbar

Most helpful comment

@vladluca : I hope you figured it out.
Someone looking to remove options from toolbar,

In the render part of Editor,
toolbar ={
{
**options:['inline', 'link', 'list', 'image' ]**, // This is where you can specify what options you need in
//the toolbar and appears in the same order as specified
inline:
{
**options:['bold', 'italic', 'underline']** // this can be specified as well, toolbar wont have
//strikethrough, 'monospace', 'superscript', 'subscript'
},
image :
{
alignmentEnabled: false,
uploadCallback: this.UploadImageCallBack,
alt: { present: true, mandatory: false },
previewImage: true
}
}
}
editorState = { this.state.value }
onEditorStateChange={ this.handleChange }
/>

On the same line, it would be possible to configure the toolbar as you want.

Document --> Default toolbar options

All 4 comments

@jpuri
I got it!

To be honest, I had a problem that image's defaultSize option doesn't work.
I solved the problem by updating the module from 1.7.3 to version 1.9.4.

Thank you very much.

I've followed the demos and docs, but I am still unable to remove the emoji from the toolbar. Any help would be great, thanks.

@vladluca : I hope you figured it out.
Someone looking to remove options from toolbar,

In the render part of Editor,
toolbar ={
{
**options:['inline', 'link', 'list', 'image' ]**, // This is where you can specify what options you need in
//the toolbar and appears in the same order as specified
inline:
{
**options:['bold', 'italic', 'underline']** // this can be specified as well, toolbar wont have
//strikethrough, 'monospace', 'superscript', 'subscript'
},
image :
{
alignmentEnabled: false,
uploadCallback: this.UploadImageCallBack,
alt: { present: true, mandatory: false },
previewImage: true
}
}
}
editorState = { this.state.value }
onEditorStateChange={ this.handleChange }
/>

On the same line, it would be possible to configure the toolbar as you want.

Document --> Default toolbar options

Was this page helpful?
0 / 5 - 0 ratings