Plugin system
Overview of the two plugin systems: EditorPlugin for browser UI panels and overlays, and CorePlugin for headless document processing in Node.js.
The editor has two plugin systems. EditorPlugin extends the browser editor with React UI: side panels, overlays painted over the pages, ProseMirror plugins, and scoped CSS. CorePlugin extends the headless document engine with command handlers that edit a Document without a browser. They share the same document model and parsers but run in different environments and do not communicate with each other.
| EditorPlugin | CorePlugin | |
|---|---|---|
| Environment | Browser (React) | Node.js (headless) |
| Extends | <DocxEditor> UI: panels, overlays, ProseMirror | Document edits via command handlers |
| Registration | <PluginHost plugins={[...]}> | pluginRegistry.register(plugin) |
| Entry point | @eigenpal/docx-editor-react/plugin-api | @eigenpal/docx-editor-core/core-plugins |
Building UI inside the editor? Write an EditorPlugin. Processing documents in API routes, Node.js scripts, or CI pipelines? Write a CorePlugin.
Getting started
The decision table in depth, how registration works, and a hello-world word count plugin.
EditorPlugin API
Full reference: panels, overlays, ProseMirror plugins, CSS injection, PluginHostRef, limitations.
CorePlugin & headless API
Command handlers, the plugin registry, and template processing in Node.js.
Examples & cookbook
Runnable example plugins and recipes: shortcuts, decorations, overlays, transaction filters.
Contributing a translation
Add a new editor language to @eigenpal/docx-editor-i18n: scaffold the locale JSON, fill the strings, validate, and open a PR. Partial translations welcome.
Getting started
Get started with docx-editor plugins: how EditorPlugin and CorePlugin compare, registration patterns, and a hello-world word count plugin walkthrough.