Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt

Use this file to discover all available pages before exploring further.

SuperDoc ships built-in UI for the toolbar, comments panel, and tracked-change review. When you need your own design system, your own layout, or your own workflow, superdoc/ui gives you the state and actions to drive it.

The layer model

Three layers, each with one job:
LayerWhat it isWhen you reach for it
Document API (editor.doc.*)Stateless request/response contract. Runs in the browser and on the server.Read or mutate document content.
superdoc/uiBrowser-only UI controller. Subscriptions, viewport geometry, per-command state.Bind your UI to live editor state.
Built-in modulesOptional UI SuperDoc renders for you.You want SuperDoc’s UI as-is.
The Document API mutates the document. superdoc/ui is what your UI subscribes to. Built-in modules are SuperDoc’s own consumer of those layers. Turn them off when you’re providing your own.

What it looks like

import { useSuperDocCommand, useSuperDocUI } from 'superdoc/ui/react';

function BoldButton() {
  const ui = useSuperDocUI();
  const bold = useSuperDocCommand('bold');

  return (
    <button
      className={bold.active ? 'active' : ''}
      disabled={bold.disabled}
      onClick={() => ui?.commands.get('bold')?.execute()}
    >
      B
    </button>
  );
}
One hook. One button. Subscribes only to that command’s state. Re-renders only when bold flips active or disabled.

What’s in this section

React setup

Provider, onReady, hooks. The scaffolding every page below builds on.

Toolbar and commands

Wire your buttons to bold, italic, lists, undo, redo, and every other built-in command.

Custom commands

Register your own commands. Override built-ins. Drive AI actions, clause inserts, business logic.

Comments

Custom comments sidebar with the typed selection-capture flow.

Track changes

Custom tracked-change review panel. Accept, reject, navigate.

Selection and viewport

Read the selection. Scroll an entity into view. Capture selections that survive focus changes.

Document control

Switch between editing and suggesting. Export to DOCX. Replace the open file.
The API reference lists every hook and handle in one place. Want to see it composed end-to-end? The reference workspace on GitHub ships a full app: toolbar, custom command, comments sidebar with reply threads, tracked-change review, selection capture, document export: built on the surfaces above.