Context Menu
A right-click menu for surface-specific actions. Supports nested submenus, checkbox and radio items, separators, and keyboard navigation. Built on Radix UI Context Menu.
Right-click here
Anatomy
- ContextMenu — Root.
- ContextMenuTrigger — Element that opens the menu on right-click.
- ContextMenuContent — The popover panel (rendered in a portal).
- ContextMenuItem — A clickable action.
- ContextMenuCheckboxItem / ContextMenuRadioItem — Stateful items.
- ContextMenuSub / ContextMenuSubTrigger / ContextMenuSubContent — Nested submenu.
- ContextMenuLabel / ContextMenuSeparator / ContextMenuShortcut — Visual helpers.
Installation
Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. |
onOpenChange | (open: boolean) => void | — | Called when open state changes. |
modal | boolean | true | When true, interaction outside closes the menu and disables outside scroll. |