Quick start
Configuration
string
CSS selector for the toolbar container (e.g.
'#toolbar'). Must be a string selector, not a DOM element reference.string[]
default:"['left', 'center', 'right']"
Layout regions for button placement
Object
Custom button arrangement by group
string[]
default:"[]"
Button names to exclude from toolbar
Object
default:"{}"
Custom SVG icons for buttons. See Icon Customization.
Object
default:"{}"
Custom tooltips and labels
Array
default:"[]"
Available font options in font dropdown. See Font Configuration.
boolean
default:"true"
Auto-hide buttons on small screens
boolean
default:"false"
Size relative to container instead of window
Array
default:"[]"
Custom button definitions. See Custom Buttons.
boolean
default:"false"
Show the formatting marks (pilcrow) button in the toolbar. Off by default. Distinct from
layoutEngineOptions.showFormattingMarks, which controls whether the marks render in the document.Available buttons
Use button names withexcludeItems, groups, and icons configuration.
Text formatting
button
Toggle bold (
Ctrl+B)button
Toggle italic (
Ctrl+I)button
Toggle underline (
Ctrl+U)button
Toggle strikethrough
button
Clear all formatting
button
Format painter: copy formatting from selection
Font controls
combobox
Editable font family selector
dropdown
Font size selector (8–96pt)
dropdown
Text color picker
dropdown
Background highlight color picker
Enter to apply, Tab to move to font size, or Esc to revert. The caret opens the full list.
If a typed name does not match an option, SuperDoc preserves that custom font name in the document. Load the font on the host page if you want it to render with its real glyphs.
The font size control follows the same flow: click the value to type a size, use the caret to open the list, and press Tab to return to the editor.
Paragraph
dropdown
Text alignment (left, center, right, justify)
button
Toggle bullet list
button
Toggle numbered list
button
Decrease indent
button
Increase indent
dropdown
Line height selector (1, 1.15, 1.5, 2, 2.5, 3)
dropdown
Quick paragraph styles (Normal, Heading 1, etc.)
Insert
dropdown
Insert or edit link
button
Upload and insert image
dropdown
Insert table via grid selector
dropdown
Table editing actions (add/delete rows/columns, merge/split cells, etc.)
Tools
button
Undo last action
button
Redo last action
dropdown
Search in document
dropdown
Zoom level (50%–200%)
button
Toggle document ruler
button
Toggle formatting marks (pilcrow) display. Hidden by default; enable with
modules.toolbar.showFormattingMarksButton: true.dropdown
Switch between editing/viewing/suggesting modes
Track changes
button
Accept tracked change at current selection
button
Reject tracked change at current selection
Custom buttons
Basic button
string
required
'button' or 'dropdown'string
required
Unique button identifier
string
Hover text
string
SVG icon string
string
default:"'center'"
Layout group:
'left', 'center', or 'right'string | function
required
Command name or handler function receiving
{ item, argument, option }Dropdown button
Array
required
Dropdown items, each with
label (display text), key (value), and optional iconboolean
default:"true"
Show dropdown arrow
Toggle button
boolean
default:"false"
Initial active state
string
Icon when active
Icon customization
Font configuration
By default, the font family combobox lists SuperDoc’s bundled defaults plus fonts used by the active document. The list is sorted alphabetically. Choosing a fallback-backed font keeps the Word-facing name in the document. For example, picking Calibri stores and exports Calibri, while the row preview can render with the bundled fallback that actually paints it. Usefonts only when you want to replace the default and document-derived list with your own static options.
Array
A custom
fonts list makes fonts selectable. It does not load font files. To make a custom font render with its real glyphs, load it on your host page via @font-face or a <link> to a font service.Loading web fonts
Any font loaded on your host page is available inside the editor. Load it, then register it infonts:
Responsive behavior
The toolbar adapts at these widths:
Use
responsiveToContainer: true to size based on the toolbar container instead of the window.
Role-based controls
The toolbar automatically adapts based on the user’s role:API methods
getToolbarItemByName
Get a toolbar item by its name.
getToolbarItemByGroup
Get all toolbar items in a layout group.
updateToolbarState
Refresh all button states based on the current editor state.
setZoom
Set the editor zoom level programmatically through the owning SuperDoc instance.
destroy
Clean up toolbar resources and event listeners.
exception
Fired when an error occurs during a toolbar action.
Full example
Custom Toolbar Example
Runnable example: custom button groups, excluded items, and a custom clear-formatting button

