Skip to content
QuireKit
Core docs
Alpha · evolving API
Core conceptsView Markdown ↗

Extension model

Learn how behavior, document structures and text formatting join an editor.

Installed extensions determine whether an editor supports headings, bold or shortcuts. Each extension groups a feature's configuration, commands and lifecycle for Editor to consume.

Choose an extension kind

AddUseExamples
Behavior without new structureExtensionShortcuts, history
A content structureNodeParagraphs, images, note groups
Formatting attached to textMarkBold, italic, links

StarterKit combines common extensions. Use it directly or configure its features for your product.

Start with a shortcut

To bind Mod-Shift-b to Bold, add behavior rather than a new node. core/shortcuts.ts uses Extension.create() and calls the existing toggleBold() in addKeyboardShortcuts().

core/shortcuts.tsts

this.editor is the receiving editor. The command uses its selection and undo history. Install the extension in the creation-time extensions array.

Configure and extend

.configure(options) changes public options; .extend(config) adds or replaces behavior. addOptions() supplies defaults, while addStorage() holds instance runtime state.

Options and storage are not document data. Persisted business fields belong in node or mark attributes. Implement a command in the behavior tutorial, then explore input rules and PM plugins and NodeViews.

Add other content capabilities

A Node defines content structure. HTML output, Canvas layout, structured selection, DOCX conversion and AI reading require their respective implementations.

Follow the note-group tutorial for a first content extension. Find existing features in plugins, and hooks and types in extension API.

QuireKitQuireKit · Core, plugins and Classic docs