Quick start
Core parameters
DOM selector or element where SuperDoc will mount.
Document to load.Can be a
Document (Object), string or FileFor a
Document object, use data for local files and url for remote files.
Provide one source field (data or url) per document object.
Use documents array for multiple documents instead.Multiple documents to load (alternative to single
document)Unique identifier for this SuperDoc instance
Auto-generated UUID if not provided
User & permissions
Current user information
All users with document access. Used for @mentions and collaboration.
User permission level
Initial document mode
See the Track Changes extension for accept/reject commands, and the runnable example for a complete workflow.
Viewing-mode visibility controls for standard comments
Viewing-mode visibility controls for tracked changes
Override permission checks for comments and tracked changes. By default, editors can resolve, edit, and delete any user’s comments and tracked changes. Use this to restrict actions.
Return
false to block an action. Return true or undefined to fall back to the built-in permission matrix. See Comments > Permission resolver for the full list of permission types.Modules
Configure optional modules
Collaboration module
Real-time collaboration settings
SuperDoc uses a provider-agnostic collaboration contract:
modules.collaboration = { ydoc, provider }.
Provider setup remains in your app code. See Collaboration configuration and Collaboration guides.Comments module
Comments system configuration
Toolbar module
Toolbar configuration
Appearance
Document title for exports and display
Colors for user awareness and highlighting
Built-in palette provided by default
Document view options for controlling layout
Use
'web' for mobile devices and WCAG AA reflow compliance (Success Criterion 1.4.10). When set to 'web', the layout engine is automatically disabled.Show document rulers
CSS selector for the toolbar container (e.g.
'#toolbar'). Shorthand for modules.toolbar.selector.Advanced options
Additional SuperDoc extensions
Custom image upload handler
Override document content with a JSON schema. Used to load documents from a previously exported JSON representation instead of a DOCX file.
Font family used for all SuperDoc UI elements (toolbar, comments, etc.)
Prevent default DOCX styles from being applied
Disable custom context menus
Callback invoked with HTML elements that were dropped during import because they have no schema representation. Receives an array of
{ tagName, outerHTML, count } items. When provided, console.warn is suppressed.Log a
console.warn listing HTML elements dropped during import. Ignored when onUnsupportedContent is provided.Content Security Policy nonce
Event handlers
All handlers are optional functions in the configuration:Called when SuperDoc is ready
Called before an editor is created
Called when editor is created
Called on content changes
Custom handler for accepting tracked changes from comment bubbles. Replaces default accept behavior when provided.
Only fires from bubble buttons, not toolbar or context menu. The dialog cleanup (closing the bubble) happens automatically after your handler runs.
Custom handler for rejecting tracked changes from comment bubbles. Replaces default reject behavior when provided.
Only fires from bubble buttons, not toolbar or context menu. The dialog cleanup (closing the bubble) happens automatically after your handler runs.
Called when the comments sidebar is toggled
Called when an error occurs

