Quick start
The context menu is enabled by default. Right-click anywhere in the document to open it. To disable it:Configuration
Top-level option to disable the context menu entirely
Whether to include the built-in menu items
Custom menu sections to add or merge. See Custom Items.
Advanced: function to fully control menu contents. See Menu Provider.
Default items
Items shown depend on document context.Right-click
| Item | Section | Condition |
|---|---|---|
| Accept change | track-changes | On a tracked change |
| Reject change | track-changes | On a tracked change |
| Insert link | general | Always |
| Insert table | general | Not inside a table |
| Edit table | general | Inside a table |
| Cut | clipboard | Text selected |
| Copy | clipboard | Text selected |
| Paste | clipboard | Always |
Custom items
Add custom items by defining sections incustomItems. Each section has an id and an array of items.
Item properties
Unique identifier for the item
Display text shown in the menu
SVG string for the item icon
Handler called when the item is clicked. Receives
(editor, context).Vue component to render as a popover when the item is selected (e.g., a table grid picker)
Function that receives the context object and returns
boolean. Items without showWhen are always visible.Custom render function for the menu item. Receives the context and should return an
HTMLElement.Merging with default sections
If a custom section has the sameid as a default section, the items are merged:
Menu provider
For full control over menu contents, usemenuProvider. It receives the context and the computed sections array, and should return a new sections array.
Context object
BothshowWhen and menuProvider receive a context object with the current editor state:
| Property | Type | Description |
|---|---|---|
trigger | 'click' | How the menu was opened |
editor | Object | The editor instance |
selectedText | string | Currently selected text |
hasSelection | boolean | Whether text is selected |
selectionStart | number | Selection start position |
selectionEnd | number | Selection end position |
isInTable | boolean | Cursor is inside a table |
isInList | boolean | Cursor is inside a list |
isTrackedChange | boolean | Cursor is on a tracked change |
trackedChangeId | string | null | ID of the tracked change at cursor |
documentMode | string | Current mode ('editing', 'viewing', 'suggesting') |
currentNodeType | string | null | Type name of the node at cursor |
activeMarks | string[] | Active mark type names at cursor |
isEditable | boolean | Whether the editor is editable |
clipboardContent | Object | Clipboard state info |
pos | number | null | Document position |
node | Object | null | Node at cursor position |
Keyboard navigation
When the menu is open:| Key | Action |
|---|---|
Arrow Down | Move to next item |
Arrow Up | Move to previous item |
Enter | Execute selected item |
Escape | Close menu |
| Type any text | Filter items by label |

