Quick start
Configuration
CSS selector for the toolbar container (e.g.
'#toolbar'). Must be a string selector, not a DOM element reference.Custom SVG icons for buttons. See Icon Customization.
Available font options in font dropdown. See Font Configuration.
Custom button definitions. See Custom Buttons.
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
Font controls
The font family control is editable. Type to autocomplete, pressEnter 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
Insert
Tools
Toggle formatting marks (pilcrow) display. Hidden by default; enable with
modules.toolbar.showFormattingMarksButton: true.Track changes
Custom buttons
Basic button
Dropdown button
Toggle button
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.
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

