Skip to main content
SuperDoc is built on ProseMirror but provides a complete document editing solution rather than a framework.
ProseMirror internals are deprecated. Direct access to editor.state, editor.view, editor.schema, editor.commands, and ProseMirror transactions will be removed in a future version. Use the Document API (editor.doc) for all programmatic document operations.

Key differences

ProseMirrorSuperDoc
Framework requiring extensive setupReady-to-use DOCX editor
Manual schema definitionPre-built Word-compatible schema
DIY file format supportNative DOCX import/export
Custom plugin systemModule-based features

What changes

// ProseMirror
import { EditorState } from "prosemirror-state";
import { EditorView } from "prosemirror-view";
import { Schema } from "prosemirror-model";
// ... 100+ lines of setup

// SuperDoc
import { SuperDoc } from "superdoc";
const superdoc = new SuperDoc({
  selector: "#editor",
  document: "document.docx",
});

Programmatic document access

The Document API (editor.doc) replaces direct ProseMirror access for all programmatic operations. 300+ operations across formatting, comments, tables, track changes, lists, images, and sections.
superdoc.on("editorCreate", ({ editor }) => {
  // Read document content
  const content = editor.doc.get();

  // Find and replace text
  const matches = editor.doc.query.match({
    select: { type: "text", pattern: "ACME Corp" },
  });
  editor.doc.replace({ target: matches.items[0].target, text: "Globex Inc" });

  // Format text
  editor.doc.format.bold({ target: matches.items[0].target });

  // Add comments
  editor.doc.comments.create({ target, content: "Please review" });
});
For backend and AI workflows, use the Node SDK, Python SDK, or CLI.

Deprecated: ProseMirror internals

The following patterns are deprecated and will stop working in a future version. Migrate to the Document API.
Previously, you could access the underlying ProseMirror instances directly:
// Deprecated — will be removed
superdoc.on("editorCreate", ({ editor }) => {
  const view = editor.view;
  const state = editor.state;
  const schema = editor.schema;
  editor.commands.toggleBold();
});

// Use the Document API instead
superdoc.on("editorCreate", ({ editor }) => {
  const content = editor.doc.get();
  editor.doc.format.bold({ target });
});

Limitations

  • No custom plugins: SuperDoc modules aren’t ProseMirror plugins
  • Fixed schema: Can’t modify the document schema
  • Use the Document API: For programmatic operations, use editor.doc — not raw ProseMirror transactions

Custom functionality

If you need features SuperDoc doesn’t provide:

Need help?