Actions & Navigation
Context Menu
A context menu opens a menu at the pointer position when a user right clicks the trigger area.
A context menu opens a menu at the pointer position when a user right clicks the trigger area.
Pass two children: the trigger element followed by a Menu.
Right click here
Component props#
| Name | Type | Description |
|---|---|---|
| children | ReactNode | Trigger element followed by a Menu |
| isOpen | boolean | Controlled open state |
| onOpenChange | (open: boolean) => void | Called when the menu opens or closes |
Remaining root props (defaultOpen, actionsRef, orientation, …) are forwarded to the underlying
Base UI ContextMenu.Root.
Parts#
| Name | Type | Description |
|---|---|---|
| ContextMenuRoot | component | The Base UI root, for explicit composition |
| ContextMenuTrigger | component | The right-click target |
| ContextMenuContent | component | The menu popup. Accepts all Menu props |
