# SuperDoc - Editor - **Get started** - [SuperDoc Editor](/editor): Understand the challenge of editing DOCX on the web and how SuperDoc approaches it with an OOXML-backed document model. - [Open and edit your first DOCX](/editor/quickstart): Install the browser Editor, open a sample DOCX, and export your first edit. - [Configure the Editor](/editor/configuration): Set how the Editor starts, then find the configuration options your integration needs. - [Choose interaction capabilities and permissions](/editor/interaction-permissions): Choose instance actions, customize client-side decisions, and enforce authorization in your backend. - [Choose a document mode](/editor/document-modes): Choose how the Editor handles edits and what appears in viewing mode. - [Handle lifecycle and events](/editor/lifecycle-and-events): Understand when the Editor is ready, what counts as an edit, and when to release it. - [Load and save a DOCX](/editor/load-and-save-documents): Load a DOCX from your application and save the edited file back to your backend. - [Control DOCX export](/editor/export-options): Download an edited DOCX, return its bytes, or package related files. - [DOCX support and known limits](/editor/docx-support): Separate package preservation, browser rendering, and editing support before choosing a document workflow. - **Interface** - [Choose your interface](/editor/who-renders-the-ui): Decide who renders the controls around the DOCX canvas. - Built-in UI - [Use the built-in UI](/editor/built-in-ui/overview): Let SuperDoc render common editor controls while your application owns access, workflow, and storage. - [Configure the built-in toolbar](/editor/built-in-ui/configure-the-toolbar): Show only the controls your workflow needs and keep them reachable as the Editor narrows. - [Add comments to the Editor](/editor/built-in-ui/comments): Let people create, reply to, and resolve comments that stay in the DOCX. - [Search and replace document text](/editor/built-in-ui/search-and-replace): Enable document-aware search, move through matches, and choose which search controls SuperDoc renders. - [Configure hyperlink behavior](/editor/built-in-ui/hyperlinks): Keep SuperDoc's defaults, suppress activation, or handle one hyperlink activation in your application. - [Configure document watermarks](/editor/built-in-ui/watermarks): Open a Word-style dialog from the toolbar or your application to inspect, add, replace, or remove text and picture watermarks. - [Configure the context menu](/editor/built-in-ui/context-menus): Add application actions or open SuperDoc's document-aware menu from your interface. - [Show content-control chrome](/editor/built-in-ui/content-controls): Show or hide content-control chrome and respond when someone clicks a structured field in the DOCX. - [Show the ruler](/editor/built-in-ui/ruler): Show the horizontal ruler and let people adjust a section's left and right page margins. - [Build a responsive Editor layout](/editor/built-in-ui/responsive-layout): Fit the document to its container, adapt built-in chrome, and refit after fullscreen changes. - [Choose a document loading UI](/editor/built-in-ui/loading): Keep SuperDoc's progress overlay or replace it with an application-owned loading state. - Custom UI - [Build a custom UI](/editor/custom-ui/overview): Keep SuperDoc's DOCX canvas while your application renders task-specific controls. - [Build your first custom control](/editor/custom-ui/controller-setup): Move Bold into your application while SuperDoc renders the document and remaining toolbar. - [Keep custom controls in sync](/editor/custom-ui/commands-and-state): Render selection-aware controls and confirm what each command did. - [Build a custom toolbar](/editor/custom-ui/formatting-controls): Scale one working custom control into an application-owned toolbar that follows the current selection. - [Build application document controls](/editor/custom-ui/zoom-and-document-state): Add application-owned zoom and DOCX download while SuperDoc keeps the remaining built-in controls. - [Build a custom comments panel](/editor/custom-ui/comments): Render comment threads, create one from selected text, and connect each row to its document anchor. - [Build a custom review panel](/editor/custom-ui/tracked-changes): Render open tracked changes and let reviewers navigate, accept, or reject each one. - [Build a document field panel](/editor/custom-ui/content-controls): Observe document fields, navigate to each one, and update typed values from application UI. - [Build custom find and replace controls](/editor/custom-ui/search): Render Search in your application while SuperDoc finds, highlights, and replaces document text. - [Build an application-owned context menu](/editor/custom-ui/context-menus): Replace SuperDoc's menu while keeping actions connected to document entities and selections. - [Build selection-aware table controls](/editor/custom-ui/tables): Enable application-owned table actions only when the current selection resolves to a table cell. - [Build an AI prompt menu for selected text](/editor/custom-ui/selection-and-viewport): Capture selected document text, place an application-owned AI prompt beside it, and keep the target when focus moves. - [Turn AI findings into tracked suggestions](/editor/custom-ui/review-highlights): Save an application-owned AI finding with its source text, then propose a document edit as a tracked change. - [Register an application command](/editor/custom-ui/custom-commands): Define one application action, then reuse its behavior and state from more than one control. - [Open dialogs and floating surfaces](/editor/dialogs-and-surfaces): Open temporary application UI over the Editor and handle every way it can finish. - [Theme the Editor UI](/editor/theming): Apply product colors to SuperDoc UI, then override one component when the semantic theme is not enough. - [Build accessible Editor experiences](/editor/accessibility): Preserve keyboard access, names, focus, status announcements, and application-owned accessibility around SuperDoc. - **Features** - [Discuss a document with comments](/editor/comments): Add a thread to selected text, reply, and resolve it without changing the passage. - [Resolve document fonts](/editor/fonts): See how each DOCX font resolves, then provide licensed files for missing families. - [Review tracked changes](/editor/track-changes): Propose an edit, accept or reject it, and keep undecided changes in the saved DOCX. - Templates and fields - [Templates and fields](/editor/content-controls): Connect application data to named regions in a DOCX, from a client name to a reusable clause. - [Fill a DOCX template](/editor/content-controls/fill-a-docx-template): Update every content-control occurrence that represents an application field, then export the DOCX. - [Add fields to a DOCX template](/editor/content-controls/add-fields-to-a-docx-template): Turn document selections into tagged inline and block-level content controls. - [Replace clauses from your application](/editor/content-controls/replace-clauses-from-your-application): Replace a tagged block-level field from application-owned UI. - [Lock template fields](/editor/content-controls/lock-template-fields): Keep a content control, its contents, or both from being changed during normal DOCX editing. - Collaboration - [Understand collaboration](/editor/collaboration): Let people edit the same document together, using your existing editor UI. - [Connect two editors](/editor/collaboration/connect-two-editors): Run the local example and watch an edit appear in another browser. - [Show who is editing](/editor/collaboration/presence-and-awareness): Give collaborators names and cursor colors, then show who is connected. - [Initialize a shared document](/editor/collaboration/initialize-a-document): Create a room from a DOCX once, then join it for every later editing session. - [Create a room safely from your backend](/editor/collaboration/coordinate-room-creation): Let one backend worker import a DOCX, then let everyone else join the completed room. - [Save and restore a room](/editor/collaboration/save-and-restore-a-room): Keep collaborative edits after everyone leaves or the server restarts. - [Observe story edits on your server](/editor/collaboration/observe-edits): Read edit attribution from collaborative story updates and schedule saved versions. - [Control access to a room](/editor/collaboration/control-room-access): Check credentials and document permissions before an editor joins a shared room. - [Run a collaboration server](/editor/collaboration/run-a-server): Choose a provider and connect room access, storage, and recovery before deployment. - [Deploy a collaboration server](/editor/collaboration/deploy-a-server): Start from a server template that checks access, stores rooms, creates each room once, and autosaves DOCX files. - [Use your own provider](/editor/collaboration/use-your-own-provider): Keep an existing Hocuspocus or other Yjs provider setup, either through built-in settings or a provider extension. - [Upgrade a local document to collaboration](/editor/collaboration/upgrade-a-document): Create a new collaboration room from the DOCX already open in a local Editor. - [Add version history](/editor/version-history): Keep each saved DOCX as an immutable version and restore one without deleting newer work. - [Add spelling and grammar proofing](/editor/platform/proofing): Connect a spelling or grammar provider to SuperDoc. - **Separator** - [Tune performance for large documents](/editor/performance-and-large-documents): Keep page rendering responsive, choose a layout, and measure representative DOCX workflows. - [Secure browser document workflows](/editor/secure-integration): Define trusted boundaries for document access, identity, persistence, integrations, and browser policy. - [Configure telemetry](/editor/telemetry): Make SuperDoc telemetry behavior explicit in the browser Editor and the CLI. - [Configure the Editor license](/editor/license): Set the browser Editor license identity. - Agents & automation - [Overview](/agents/overview): Understand how an agent uses SuperDoc to edit a DOCX, then choose a starting point. - MCP server - [Connect a coding agent over MCP](/agents/mcp/connect): Install the SuperDoc MCP server so Claude Code, Cursor, Windsurf, or Claude Desktop can open, edit, and save DOCX files. - [Edit a DOCX from a coding agent](/agents/mcp/first-document-task): Make one tracked edit with your coding agent, save a copy, and review the result in the Editor. - [Debug the MCP server](/agents/mcp/debugging): Inspect the SuperDoc MCP server directly, read its log, and recognize the failures that look like something else. - Agents - [Build an agent](/agents/build/build-an-agent): Give your product's agent document tools with a bounded, verifiable loop. - [Tools and presets](/agents/build/tools): Understand the action surface a model sees, and narrow it when a workflow should not reach every operation. - [Core action reference](/agents/build/actions): The arguments, selectors, placements, and receipts behind superdoc_inspect and superdoc_perform_action. - [Add a custom action](/agents/build/custom-actions): Extend the core preset with your own named document verb, exposed to the model through superdoc_perform_action. - [Connect a model provider](/agents/build/providers): Wire the toolkit to Anthropic, OpenAI, the Vercel AI SDK, Amazon Bedrock, or Python, and cache the static prefix. - [Install the custom-actions skill](/agents/build/skills): Give Claude Code or Codex a SuperDoc skill that authors custom actions correctly. - [Legacy tools](/agents/build/legacy-tools): What the legacy preset advertises, why it is still the default, and how to move to core. - Automation - [Automate a DOCX with Node.js](/agents/automation/node-sdk): Query a DOCX, accept its tracked changes, and save the result from Node.js. - [Automate a DOCX with Python](/agents/automation/python-sdk): Accept tracked changes and save a separate DOCX from Python. - [Automate a DOCX with Rust](/agents/automation/rust-sdk): Accept tracked changes and save a separate DOCX from Rust. - [Automate a DOCX from the CLI](/agents/automation/cli): Accept tracked changes and save a separate DOCX from a shell or CI job. - Workflows - [Review tracked changes](/agents/workflows/review-tracked-changes): Create a tracked DOCX edit in code, review it in the embedded editor, and export the decision. - Operate - [Safety](/agents/operate/safety): Operational boundaries to settle before an agent edits documents that matter. - [Debug an agent run](/agents/operate/debugging): Separate model mistakes from operation failures, read dispatcher errors by code, and trace a run without logging document content. - [Manage context and cost](/agents/operate/context-and-cost): Keep the static prefix cached, keep inspect results small, and narrow the surface so a run fits its token budget. - Document API - [Document API mental model](/document-api/mental-model): Query a document, identify a target, apply a mutation, and inspect its receipt. - [Store application data in DOCX](/document-api/application-data): Choose the DOCX structure that matches how your application stores and presents data. - [Query document content](/document-api/query-content): Find text in an open DOCX and keep mutation-ready targets. - [Capture a selection as Word XML](/document-api/selection-ooxml): Save the selected content and the DOCX parts it needs from an open document. - [Project HTML and Markdown](/document-api/output-projections): Choose a review view, scope document content, inspect fidelity, and map serialized output back to document targets. - [Insert HTML and Markdown](/document-api/rich-content): Convert, inspect, and apply bounded HTML or Markdown content to an open DOCX. - [Replace and delete content](/document-api/replace-delete-content): Use fresh query targets to change an open DOCX and inspect each mutation receipt. - [Preview and apply mutation plans](/document-api/mutation-plans): Validate several document edits, then apply them together against one document revision. - [Work with tracked changes](/document-api/tracked-changes): Create reviewable edits, inspect open changes, and accept or reject an explicit change. - [Compare and apply tracked changes](/document-api/document-comparison): Compare two documents, apply the result as a reviewable tracked change, and check what document shapes are supported before you rely on it. - [Create and resolve comment threads](/document-api/comments): Anchor a DOCX comment to document content, add a reply, and resolve the thread. - [Apply a template to an existing document](/document-api/templates): Adopt the styles, numbering, theme, headers, footers, and page setup of a template DOCX into an open document, preview the change with a dry run, and read what was applied. - [Extract and reuse a style guide](/document-api/style-guides): Read a DOCX's theme, document defaults, and styles into an editable guide, write the edits back, and apply the result to new drafts as a template. - [Receipts and errors](/document-api/receipts-and-errors): Check capabilities, inspect mutation results, and recover safely from stale document state. - Reference - [Document API reference](/document-api/reference): Search and inspect every operation generated from the canonical Document API contract. - Table of Authorities - [Table of Authorities operations](/document-api/reference/authorities): Table of authorities lifecycle and TA entry operations. - Blocks - [Blocks operations](/document-api/reference/blocks): Block-level structural operations. - Bookmarks - [Bookmarks operations](/document-api/reference/bookmarks): Named bookmark inspection, insertion, renaming, and removal. - Capabilities - [Capabilities operations](/document-api/reference/capabilities): Runtime support discovery for capability-aware branching. - Captions - [Captions operations](/document-api/reference/captions): Caption (SEQ field) inspection, insertion, update, removal, and numbering configuration. - Citations - [Citations operations](/document-api/reference/citations): Citation, source, and bibliography lifecycle operations. - Clipboard - [Clipboard operations](/document-api/reference/clipboard): Clipboard parsing, model insertion, and selection serialization. - Comments - [Comments operations](/document-api/reference/comments): Comment authoring and thread lifecycle operations. - Content Controls - [Content Controls operations](/document-api/reference/content-controls): Content control (SDT) discovery, mutation, typed controls, and Word compatibility. - Core - [Core operations](/document-api/reference/core): Primary read and write operations. - Create - [Create operations](/document-api/reference/create): Structured creation helpers. - Cross-References - [Cross-References operations](/document-api/reference/cross-refs): Cross-reference field inspection, insertion, rebuild, and removal. - Custom XML - [Custom XML operations](/document-api/reference/custom-xml): Custom XML Data Storage Part operations (ECMA-376 §15.2.5, §15.2.6). Raw read and write of custom XML parts in the OOXML package. - Diff - [Diff operations](/document-api/reference/diff): Snapshot-based document comparison and replay. - Index - [Index operations](/document-api/reference/document-index): Index (TABLE OF AUTHORITIES / INDEX field) lifecycle and XE entry operations. - Export - [Export operations](/document-api/reference/export): Modeful DOCX export (review-preserving / final / original) with a structured degradation report. - Fields - [Fields operations](/document-api/reference/fields): Raw field code inspection, insertion, rebuild, and removal. - Footnotes - [Footnotes operations](/document-api/reference/footnotes): Footnote and endnote lifecycle and numbering configuration. - Format - [Format operations](/document-api/reference/format): Canonical formatting mutation with directive semantics ('on', 'off', 'clear'). - Paragraph Formatting - [Paragraph Formatting operations](/document-api/reference/format/paragraph): Paragraph-level direct formatting: alignment, indentation, spacing, borders, shading, and more. - Headers & Footers - [Headers & Footers operations](/document-api/reference/header-footers): Structure, references, and part lifecycle for document headers and footers. - History - [History operations](/document-api/reference/history): Undo/redo history state and navigation. - Hyperlinks - [Hyperlinks operations](/document-api/reference/hyperlinks): Hyperlink discovery, creation, and metadata management. - Images - [Images operations](/document-api/reference/images): Image lifecycle, placement, and wrap configuration. - Lists - [Lists operations](/document-api/reference/lists): List inspection and list mutations. - Anchored Metadata - [Anchored Metadata operations](/document-api/reference/metadata): Attach a JSON payload to a span of text and read it back across DOCX round-trips. Backed by hidden inline content controls and namespaced Custom XML Data Storage Parts; consumers see one operation set. - Mutations - [Mutations operations](/document-api/reference/mutations): Atomic mutation plan preview and execution. - Permission Ranges - [Permission Ranges operations](/document-api/reference/permission-ranges): Permission range exception operations for protected documents. - Protection - [Protection operations](/document-api/reference/protection): Document-level protection state and editing restriction operations. - Query - [Query operations](/document-api/reference/query): Deterministic selector-based queries for mutation targeting. - Ranges - [Ranges operations](/document-api/reference/ranges): Deterministic range construction from explicit document anchors. - Sections - [Sections operations](/document-api/reference/sections): Section structure and page-setup operations. - Selection - [Selection operations](/document-api/reference/selection): Read the editor's current selection as a portable, addressable target. - Styles - [Styles operations](/document-api/reference/styles): Document-level stylesheet mutations (docDefaults, style definitions). - Paragraph Styles - [Paragraph Styles operations](/document-api/reference/styles/paragraph): Paragraph style reference operations (set/clear w:pStyle). - Tables - [Tables operations](/document-api/reference/tables): Table structure, layout, styling, and cell operations. - Templates - [Templates operations](/document-api/reference/templates): Apply detected DOCX template/substrate (styles, numbering, settings, theme, font table, web settings, custom XML) from a source package onto the current document while preserving body content. - Table of Contents - [Table of Contents operations](/document-api/reference/toc): Table of contents lifecycle and configuration. - Track Changes - [Track Changes operations](/document-api/reference/track-changes): Tracked-change inspection and review operations. - Watermarks - [Watermarks operations](/document-api/reference/watermarks): Word-compatible text and picture watermark lifecycle and placement. - Resources - [How SuperDoc works](/resources/how-superdoc-works): Understand how SuperDoc keeps OOXML as the document source across browser and headless workflows. - [Package compatibility](/resources/package-compatibility): Understand how SuperDoc declares and changes npm peer dependency compatibility. - [Trust & Security](/resources/security): Review SuperDoc's SOC 2 controls, deployment model, data practices, infrastructure, and vulnerability disclosure program. - [Licensing](/resources/license): Compare SuperDoc's open-source and commercial licensing options. - Migrate from v1 - [Migrate from v1](/editor/migrate-from-v1/overview): Move a browser editor from SuperDoc v1 to the v2 DOCX engine. - [Removed in v2](/editor/migrate-from-v1/removed-apis): Every v1 import and editor internal that no longer works in SuperDoc v2, and what replaces it. ## Machine-readable exports - [Guide corpus](/llms-full.txt): All authored guides in one file, without the generated API reference. - [Document API reference corpus](/llms-reference.txt): A large, exhaustive generated reference. Prefer focused reference pages when only a few operations are needed.