Skip to main content
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