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

PropTypeDefaultDescription
open
booleanControlled open state.
onOpenChange
(open: boolean) => voidCalled when open state changes.
modal
booleantrueWhen true, interaction outside closes the menu and disables outside scroll.