Quick start
Core parameters
string | HTMLElement
required
DOM selector or element where SuperDoc will mount.
Document | string | File
required
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.Document[]
Multiple documents to load (alternative to single
document)string
Unique identifier for this SuperDoc instance
Auto-generated UUID if not provided
User & permissions
Object
Current user information
User[]
default:"[]"
All users with document access. Used for @mentions and collaboration.
string
default:"'editor'"
User permission level
string
default:"'editing'"
Initial document mode
See the Track Changes module for accept/reject commands, the Document API, and configuration. The runnable example shows a complete workflow.
Object
Viewing-mode visibility controls for standard comments
Object
deprecated
function
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
Object
Configure optional modules
Collaboration module
Object
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
Object
Comments system configuration
Track changes module
Object
Track changes configuration. Supersedes the top-level
trackChanges and layoutEngineOptions.trackedChanges keys, which remain supported as deprecated aliases.Toolbar module
Object
Toolbar configuration
Surface defaults
Object
Optional defaults and resolver for SuperDoc surfaces.
You only need
modules.surfaces if you want shared defaults, a central resolver, or to enable/configure built-in surface behaviors like find/replace and the password prompt. Direct superdoc.openSurface(...) calls do not require any special setup.Content controls module
Object
Content-control rendering configuration.
Spell check
Provider-based spell check for the layout-engine editor surface. The configuration key isproofing because the provider contract is designed to support spelling, grammar, and style. The current UI renders spelling only.
Bring your own provider. SuperDoc handles the editor UI. Your app controls the spell-check engine or API. See Spell check and Custom spell-check provider.
Spell check runs when the layout engine is active. In
print layout this works out of the box. In web layout, keep the layout engine enabled with layoutEngineOptions.flowMode: 'semantic'.Only spelling issues render in v1. Grammar and style issues can still be returned by your provider but are not shown yet.
Object
Spell-check configuration
Appearance
string
default:"'SuperDoc'"
Document title for exports and display
string[]
Colors for user awareness and highlighting
Built-in palette provided by default
Object
Document view options for controlling layout
Use
'web' for mobile devices and WCAG AA reflow compliance (Success Criterion 1.4.10). If you also need layout-engine-powered features such as proofing in web layout, set layoutEngineOptions.flowMode: 'semantic'.boolean
default:"false"
Enable contained mode for fixed-height container embedding. When
true, SuperDoc fits within its parent’s height and scrolls internally instead of expanding to the document’s natural height. Works with DOCX, PDF, and HTML documents.Use this when embedding SuperDoc inside a panel, sidebar, or any container with a fixed height (e.g., height: 400px or flex: 1).Object
Zoom behavior for the document. Use
mode: 'fit-width' to keep DOCX and PDF documents fitted to the available container width. Calling setZoom() switches back to manual zoom.For custom behavior, listen to viewport-change and call setZoom() yourself.Responsive zoom example
Minimal React example for fit-width zoom with current zoom and viewport metrics.
string
deprecated
Object
deprecated
boolean
default:"false"
Show document rulers
string
CSS selector for the built-in toolbar container (e.g.
'#toolbar'). Shorthand for modules.toolbar.selector.Omit this to skip the built-in toolbar: for example, when using the headless toolbar to build your own UI.Advanced options
Extension[]
default:"[]"
Additional SuperDoc extensions
function
Custom image upload handler
Object
deprecated
Object
Override document content with a JSON schema. Used to load documents from a previously exported JSON representation instead of a DOCX file.
string
default:"'Arial, Helvetica, sans-serif'"
Font family used for all SuperDoc UI elements (toolbar, comments, etc.)
boolean
default:"false"
Prevent default DOCX styles from being applied
Disable custom context menus
function
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.boolean
default:"false"
Log a
console.warn listing HTML elements dropped during import. Ignored when onUnsupportedContent is provided.string
Content Security Policy nonce
Event handlers
All handlers are optional functions in the configuration:function
Called when SuperDoc is ready
function
Called before an editor is created
function
Called when editor is created
function
Called on content changes
function
Called when zoom changes from
setZoom(), the toolbar zoom control, or fit-width mode.function
Called when the fit-width calculation changes. Pixel-level width jitter is deduped.
getViewportMetrics() always reads the latest measurements.function
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.
function
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.
function
Called when the comments sidebar is toggled
function
Called when an error occurs

