Skip to main content
Custom extensions are an advanced surface. For most app-level customization, the Document API handles document mutations and Custom UI handles toolbar, comments, and review panels — both are stable, framework-friendly, and aligned with SuperDoc’s document model. Reach for custom extensions only when you need editor internals (custom marks, nodes, or chain commands).
Create extensions to add custom features to SuperDoc.

Basic extension

Extension types

Node extension

For document elements:

Mark extension

For inline formatting:

Adding features

Commands

Keyboard shortcuts

ProseMirror plugins

Your extension can also define ProseMirror plugins which will let you perform more advanced things, such as listening to browser events attached to a node.
You can read more about ProseMirror’s plugin system here.

Configuration

Type-safe factories

Use defineNode and defineMark instead of Node.create() / Mark.create() for typed attributes:
With TypeScript generics you get full attribute autocompletion:

Type guards

Use type guards when traversing the document to get typed node/mark attributes:

Using your extension