Overview
The command menu is triggered by pressing/ in the editor. It provides a searchable list of components and content types you can insert.
Triggering the command menu
Press/ when:
- The cursor is in an empty paragraph
- The cursor is at the very beginning of a line
The command menu will not trigger if you’re typing inside a CodeMirror code editor (inside a code snippet component).
Navigating the menu
Available commands
Text formatting
Heading 1
Heading 1
Description: Big section headingShortcut: Type
# (hash followed by space)Usage:Heading 2
Heading 2
Description: Medium section headingShortcut: Type
## (two hashes followed by space)Usage:Heading 3
Heading 3
Description: Small section headingShortcut: Type
### (three hashes followed by space)Usage:Text
Text
Description: Just start writing with plain textUsage: Creates a plain paragraph (this is the default)
Bulleted list
Bulleted list
Description: Create a simple bulleted listShortcut: Type
- (dash followed by space)Usage:Quote
Quote
Description: Capture a quoteShortcut: Type
> (greater than followed by space)Usage:Code components
Code
Code
Description: Capture a code snippet with syntax highlightingComponent:
code_snippetAttributes: language, codeUsage: Insert via command menu, then click to edit code and select languageMermaid
Mermaid
Description: Create a mermaid diagramComponent:
mermaidAttributes: codeUsage:Container components
Card
Card
Description: Create a horizontal or vertical cardComponent:
cardAttributes: title, icon, showIcon, horizontal, hrefUsage:- Insert via command menu
- Click title or icon to edit
- Hover to toggle layout
- Supports nested content
Callout
Callout
Description: Add a callout (info, warning, caution, etc.)Component:
calloutAttributes: type (info | warning | caution | important | tip)Usage:- Insert via command menu
- Click icon to change callout type
- Type inside to add content
Accordion
Accordion
Description: Add a collapsible accordion sectionComponent:
accordionAttributes: titleUsage:- Insert via command menu
- Click title to edit
- Type inside to add content
- Users can expand/collapse in read-only mode
Frame
Frame
Description: Add a frame with padding and optional captionComponent:
frameAttributes: captionUsage:- Insert via command menu
- Click caption area to edit
- Type inside to add framed content
Step
Step
Description: Create a numbered step (for tutorials)Component:
stepAttributes: titleUsage:- Insert via command menu
- Multiple steps auto-number sequentially
- Click title to edit
Columns
Columns
Description: Create a responsive columns/grid layoutComponent:
columnsAttributes: cols (number of columns)Usage:- Insert via command menu
- Contains
columnchild components - Responsive layout collapses on mobile
Tabs
Tabs
Description: Create a tabbed interfaceComponent:
tabsAttributes: tabs (array of tab labels)Usage:- Insert via command menu
- Edit tab labels in modal
- Add content for each tab
Parameter Field
Parameter Field
Description: Document a parameter with name, type, and descriptionComponent:
fieldAttributes: name, type, requiredUsage:- Insert via command menu
- Perfect for API documentation
- Shows type and required badge
Inline components
Icon
Icon
Description: Insert an icon from Lucide iconsComponent:
iconAttributes: icon, sizeUsage:- Insert via command menu
- Click to change icon or size
- All Lucide icons supported
Badge
Badge
Description: Add a badge with custom text and stylingComponent:
badgeAttributes: label, variant (default | secondary | destructive | outline)Usage:- Insert via command menu
- Click to edit label and style
- Inline element
Break
Break
Description: Add spacing between contentComponent:
breakAttributes: size (small | medium | large)Usage:- Insert via command menu
- Creates vertical spacing
- Useful for visual separation
Command filtering
The command menu supports real-time search:- Command name (e.g., “Card”)
- Command description (e.g., “horizontal or vertical”)
- Command ID (e.g., “card”)
Command menu implementation
The command menu is defined incommand-system.tsx and includes:
- SimpleCommand - Writes text (e.g.,
"# "for Heading 1) - ComponentCommand - Inserts a component node (e.g.,
card,callout) - CommandSeparator - Visual separator in the menu
Keyboard shortcuts
Command menu keyboard controls (index.tsx:425-485):
| Key | Action |
|---|---|
/ | Open command menu |
| Arrow Down | Select next command |
| Arrow Up | Select previous command |
| Enter | Insert selected command |
| Escape | Close menu |
| Type | Filter commands |
The menu automatically skips separator items when navigating with arrow keys.
Custom command hint
When the cursor is in an empty paragraph, a hint appears:index.tsx:714-729):
- Appears only when
editable={true} - Positions at the cursor location
- Disappears when typing begins
- Updates on scroll and resize
Extending the command menu
To add new commands, modifycommand-system.tsx:60-162: