Documentation
Getting Started
Foundations
Form
Layout
Display
Navigation
Overlay
Feedback
Context Menu
Overlay
A versatile context menu component that appears on right-click or long press, providing contextual actions and options with support for items, checkboxes, radio groups, separators, shortcuts, and nested submenus.
Installation
bash
1npx @dinachi/cli@latest add context-menuRun the CLI command above to automatically install the component and its dependencies.
Examples
Default Context Menu
A basic context menu with menu items and shortcuts
Right click here
Context Menu with Checkbox
Context menu with checkbox items for toggleable options
Right click for checkbox menu
Context Menu with Radio Group
Context menu with radio group for single selection
Right click for radio menu
Current: pedro
Current: pedro
Context Menu with Submenu
Context menu with nested submenus for hierarchical options
Right click for submenu
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | false | Whether the context menu is open by default |
open | boolean | — | Controls the open state of the context menu |
onOpenChange | (open: boolean) => void | — | Callback fired when the context menu open state changes |
disabled | boolean | false | Whether the context menu is disabled |
childrenrequired | React.ReactNode | — | The content of the context menu |