I wanted to configure the Ckeditor toolbar in React, but I don't know where is the property details in the documentation. Ckeditor React integration documentation didn't help because it doesn't contain much information.
I tried this :
import CKEditor from "ckeditor4-react"
<CKEditor
data={this.state.data}
onChange={this.onEditorChange}
config={{
toolbar: [
["Bold", "Italic", "Strike Through"],
[
"Cut",
"Copy",
"Paste",
"Pasteasplaintext",
"FormattingStyles",
"Undo",
"Redo"
],
["List", "Indent", "Blocks", "Align", "Bidi", "Paragraph"],
["Find", "Selection", "Spellchecker", "Editing"]
]
}}
/>
But some of these configurations didn't show up because I was guessing the property. I know there is toolbar configuration generator in documentation, but I don't know where to put this in React :
CKEDITOR.editorConfig = function( config ) {
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'forms', groups: [ 'forms' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
'/',
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'others', groups: [ 'others' ] },
{ name: 'about', groups: [ 'about' ] }
];
config.removeButtons = 'Source,Save,Templates,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,RemoveFormat,CreateDiv,BidiLtr,BidiRtl,Image,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,About';
};
I wanted to configure the Ckeditor toolbar in React, but I don't know where is the property details in the documentation. Ckeditor React integration documentation didn't help because it doesn't contain much information.
I tried this :
import CKEditor from "ckeditor4-react"
<CKEditor
data={this.state.data}
onChange={this.onEditorChange}
config={{
toolbar: [
["Bold", "Italic", "Strike Through"],
[
"Cut",
"Copy",
"Paste",
"Pasteasplaintext",
"FormattingStyles",
"Undo",
"Redo"
],
["List", "Indent", "Blocks", "Align", "Bidi", "Paragraph"],
["Find", "Selection", "Spellchecker", "Editing"]
]
}}
/>
But some of these configurations didn't show up because I was guessing the property. I know there is toolbar configuration generator in documentation, but I don't know where to put this in React :
CKEDITOR.editorConfig = function( config ) {
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'forms', groups: [ 'forms' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
'/',
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'others', groups: [ 'others' ] },
{ name: 'about', groups: [ 'about' ] }
];
config.removeButtons = 'Source,Save,Templates,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,RemoveFormat,CreateDiv,BidiLtr,BidiRtl,Image,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,About';
};
Share
Improve this question
asked Aug 20, 2019 at 14:58
panji gemilangpanji gemilang
8092 gold badges13 silver badges31 bronze badges
1 Answer
Reset to default 23I use it like this:
import CKEditor from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
<CKEditor
data={input.value}
editor={ ClassicEditor }
config={{
toolbar: ['heading', '|', 'bold', 'italic', 'blockQuote', 'link', 'numberedList', 'bulletedList', 'imageUpload', 'insertTable',
'tableColumn', 'tableRow', 'mergeTableCells', 'mediaEmbed', '|', 'undo', 'redo']
}}
/>
The full list of toolbar options is there:
*["undo", "redo", "bold", "italic", "blockQuote", "ckfinder", "imageTextAlternative", "imageUpload", "heading", "imageStyle:full", "imageStyle:side", "link", "numberedList", "bulletedList", "mediaEmbed", "insertTable", "tableColumn", "tableRow", "mergeTableCells"]*