Skip to main content
A contextual command menu triggered by right-clicking. Shows relevant actions based on cursor position and document state.

Quick start

The context menu is enabled by default. Right-click anywhere in the document to open it. To disable it:

Configuration

boolean
default:"false"
Top-level option to disable the context menu entirely
boolean
default:"true"
Whether to include the built-in menu items
Array
default:"[]"
Custom menu sections to add or merge. See Custom Items.
function
Advanced: function to fully control menu contents. See Menu Provider.

Default items

Items shown depend on document context.

Right-click

Custom items

Add custom items by defining sections in customItems. Each section has an id and an array of items.

Item properties

string
required
Unique identifier for the item
string
required
Display text shown in the menu
string
SVG string for the item icon
function
Handler called when the item is clicked. Receives (editor, context).
Component
Vue component to render as a popover when the item is selected (e.g., a table grid picker)
function
Function that receives the context object and returns boolean. Items without showWhen are always visible.
function
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 same id as a default section, the items are merged:
For full control over menu contents, use menuProvider. It receives the context and the computed sections array, and should return a new sections array.
menuProvider runs after default items and customItems are merged. If it returns null or undefined, the original sections are used.

Context object

Both showWhen and menuProvider receive a context object with the current editor state:

Keyboard navigation

When the menu is open: