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#

NameTypeDescription
childrenReactNodeTrigger element followed by a Menu
isOpenbooleanControlled open state
onOpenChange(open: boolean) => voidCalled when the menu opens or closes

Remaining root props (defaultOpen, actionsRef, orientation, …) are forwarded to the underlying Base UI ContextMenu.Root.

Parts#

NameTypeDescription
ContextMenuRootcomponentThe Base UI root, for explicit composition
ContextMenuTriggercomponentThe right-click target
ContextMenuContentcomponentThe menu popup. Accepts all Menu props