Toolbar and menus
Toolbar
Section titled “Toolbar”The toolbar is a string of control names. | separates groups.
createEditor({ element, toolbar: 'undo redo | blocks | bold italic underline | link image table | bullist numlist',});You can also pass an array of groups, or false to hide the toolbar and build your own UI with
editor.exec() (the React and Vue
packages include hooks for that).
When the toolbar does not fit, extra controls move into a ⋯ overflow menu
(toolbarMode: 'sliding', the default). Use toolbarMode: 'wrap' to wrap onto several rows.
Controls are moved from the end, so put the most important groups first.
The default toolbar is:
undo redo | blocks | bold italic underline strikethrough moreformats | forecolor backcolor |link image table | bullist numlist | align lineheight outdent indent | fontfamily fontsize |blockquote codeblock hr | removeformat | searchreplace preview code fullscreen helpBuilt-in controls
Section titled “Built-in controls”| Group | Controls |
|---|---|
| History | undo redo |
| Blocks | blocks h1…h6 blockquote codeblock hr |
| Text | bold italic underline strikethrough subscript superscript inlinecode moreformats removeformat |
| Style | forecolor backcolor fontfamily fontsize lineheight |
| Alignment | align alignleft aligncenter alignright alignjustify indent outdent |
| Lists | bullist numlist |
| Insert | link unlink image table insertdatetime (plugin) |
| Tables | tableinsertrowbefore tableinsertrowafter tabledeleterow tableinsertcolbefore tableinsertcolafter tabledeletecol tablemergecells tablesplitcells tablerowheader tablecolheader tablecellbackground tableprops tablecellprops advtablesort tabledelete |
| Images | imagealignleft imagealigncenter imagealignright imagesize imagealt imagedelete |
| Tools | searchreplace pastetext code preview fullscreen help |
Table and image controls also appear in context toolbars when a table cell or an image is selected.
Tables can be sorted by the column with the cursor (advtablesort: numbers numerically, text
in the editor’s language, header rows stay on top). tableprops sets the table width (100%,
600px) and alignment; tablecellprops sets vertical alignment, header vs data cell and the column
width in pixels, which also works on touch screens. Wide tables scroll inside the editor on narrow
screens.
Menu bar
Section titled “Menu bar”createEditor({ element, menubar: true }); // File · Edit · View · Insert · Format · Table · HelpcreateEditor({ element, menubar: 'edit insert format' }); // only some menusOverride or add menus with menu:
createEditor({ element, menubar: 'insert tools', menu: { insert: { title: 'Insert', items: 'image link | hr' }, tools: { title: 'Tools', items: 'searchreplace code' }, },});Menu items use the same names as toolbar controls, including your own buttons registered with
editor.ui.registry.addButton().
mode |
What you get |
|---|---|
'classic' |
a framed editor with the toolbar on top (default) |
'inline' |
no frame; the toolbar appears above the text while the editor has focus |
'distraction-free' |
no toolbar; formatting appears next to the selection (with the quickbars plugin) |
createEditor({ element, mode: 'distraction-free', plugins: ['quickbars'] });Keyboard
Section titled “Keyboard”| Shortcut | Action |
|---|---|
| Alt+F10 | move focus to the toolbar |
| Alt+F9 | move focus to the menu bar |
| Ctrl+F9 | move focus to the context toolbar |
| Esc | return focus to the text |
| Ctrl/Cmd+K | insert or edit a link |
| Ctrl/Cmd+F | search and replace |
| Ctrl/Cmd+Shift+F | fullscreen |
| Alt+0 | keyboard help |
Markdown shortcuts while typing: # to ###### followed by a space for headings, - or * for
bullets, 1. for numbered lists, > for a quote, three backticks for a code block. Type / for
slash commands.