Skip to main content
Command menu triggered by typing a character (default: /).

SlashCommand

SlashCommandItem[]
default:"defaultSlashCommands"
Array of commands to display. Falls back to defaultSlashCommands when not provided.
(items, query, editor) => SlashCommandItem[]
Custom filter function. By default, uses fuzzy matching on title, description, and search terms.
string
default:"/"
Character that triggers the command menu.
(props: { editor }) => boolean
Controls when the menu can appear. Return false to prevent it.
(props: SlashCommandRenderProps) => VNode[]
Custom rendering for the command list. Receives items, query, selectedIndex, and onSelect.

Custom rendering

Use the default slot to fully customize how the command list looks. The slot receives the filtered items, current query, selected index, and a callback to select an item:

Custom commands

Pass your own items to add domain-specific commands alongside (or instead of) the defaults:

SlashCommandItem

The icon is what renders next to the command: an element, like h(ImageIcon, { size: 18 }), or a component.

SlashCommandRenderProps


Default commands

The defaultSlashCommands export includes these built-in commands:

CSS import