Command menu
The command menu is triggered by pressing/ on an empty line:
Command menu implementation
~/workspace/source/packages/webeditor/src/editor/index.tsx:254-312
The command menu won’t open if you’re inside a code snippet editor to avoid interfering with typing code.
Command types
Commands come in three types:- Simple commands
- Component commands
- Attribute commands
Commands that insert text patterns:
Built-in components
WebEditor includes a comprehensive set of components for different use cases:Content components
Card
Displays content with a title, optional icon, and horizontal or vertical layout
Callout
Highlights important information with different variants (info, warning, error, success)
Accordion
Creates collapsible sections for FAQs or detailed content
Frame
Wraps content with padding and an optional caption
Layout components
Tabs
Tabs
Create tabbed interfaces for organizing related content:
Columns
Columns
Create responsive multi-column layouts:
Break
Break
Add vertical spacing between sections:
Code components
- Code snippet
- Mermaid
Syntax-highlighted code blocks with language support and titles:Or use markdown code fences:
Documentation components
Step
Document step-by-step processes:
Field
Document API parameters with name, type, and description:
Inline components
Badge
Badge
Inline badges for labels and status indicators:
Icon
Icon
Insert Lucide icons inline:
Component node views
Each component is rendered using a React node view that handles both editing and display:Example: Card component structure
Node specifications
Each component defines a node spec that describes its structure:~/workspace/source/packages/webeditor/src/editor/components/card.tsx:218-254
Insert functions
Each component has an insert function that creates the node programmatically:Example: Card insert function
Icon system
Many components support icons from Lucide React:Dynamic icon loading
Icons are loaded dynamically and cached for performance. Icon names are automatically normalized from kebab-case or snake_case to PascalCase.
Command menu setup
All available commands are defined incommandMenuSetup:
~/workspace/source/packages/webeditor/src/editor/utils/command-system.tsx:60-162
Editable context
Components respect the editor’s editable state:When
editable={false} is passed to WebEditor, all components render in read-only mode without edit controls.Next steps
Marks system
Learn about text marks and inline formatting
API Reference
Explore detailed component API documentation