ContextMenu
Reveal actions where someone right-clicks or presses and holds on touch.
Basic usage
Attach the menu to the relevant content with the asChild render function and forward its props. Offer the same actions in a separate DropdownMenu for keyboard and click access.
API
Key props and defaults.
| Prop | Values and behavior | Default |
|---|---|---|
Root.defaultOpen | boolean | false |
Root.open / onOpenChange | boolean / ({ open }) => void | — |
Trigger.asChild | (props) => JSX.Element | — |
Item.value | string | — |
Item.onSelect | () => void | — |