Actions

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.

PropValues and behaviorDefault
Root.defaultOpenbooleanfalse
Root.open / onOpenChangeboolean / ({ open }) => void—
Trigger.asChild(props) => JSX.Element—
Item.valuestring—
Item.onSelect() => void—