The modules export
Import the modules named export to access the built-in module definitions as a plain object keyed by module name.
modules into an array to pass all built-in modules to the editor, then append your own custom definitions:
The
modules option defines which module objects are available to the editor. The toolbar option separately controls which of those module names actually appear as buttons, and in what order and grouping. A module must be registered in modules before you can reference its name in toolbar.Built-in modules
The table below lists all 17 built-in modules, their group classification, and a short description of what each one does.Groups at a glance
inline
Formatting applied to a text selection without changing the block structure: bold, italic, underline, strikethrough.
block
Commands that change the type of the current block element: h1, h2, h3, paragraph, ul, ol, blockquote, code.
history
Undo/redo operations that traverse the editor’s change history: undo, redo.
insert
Commands that insert new content or elements at the cursor: link, image.
view
Commands that switch the editor’s display mode: html (toggle raw HTML source view).
Module interface
Every module — built-in or custom — must conform to the following object shape.string
required
A unique string identifier for the module. This is the value you reference in the
toolbar option to place the button. Must not collide with any existing built-in module name unless you intend to replace it.string
required
A logical grouping label used for documentation and potential style targeting. Built-in values are
'inline', 'block', 'history', and 'insert', but custom modules may use any string.string
required
An HTML string rendered as the button’s visual content. You can use a Unicode character, an emoji, an inline SVG, or an icon ligature string. The string is set as
innerHTML, so SVG markup is fully supported.string
required
A plain-text string used as the button’s tooltip and
aria-label. Keep it short and descriptive — this is the primary accessibility affordance for keyboard and screen-reader users.(editor: Editor) => void
required
The function called when the user clicks the toolbar button. Receives the live
Editor instance, giving you access to the full editor API to read selection state, manipulate content, or trigger other commands.