Primitives
Primitive

Context Menu

Right-click menu that displays contextual actions for specific elements

The context menu opens on right-click and lists actions scoped to the element under the cursor. Use it for row actions in a table, canvas or editor commands, or any desktop-style secondary menu; for a button-triggered menu, use Dropdown Menu instead.

Preview

Right click here

Installation

Usage

Composition

Examples

With Submenus

Nest a ContextMenuSub to open a second menu from a trigger item.

Right click here

With Separators and Shortcuts

Use ContextMenuSeparator to divide groups and ContextMenuShortcut to show key hints.

Right click here

With Checkboxes and Radio Groups

Use ContextMenuCheckboxItem for toggles and ContextMenuRadioGroup for single-choice options.

Right click here

API Reference

ContextMenuContent

Prop

ContextMenuItem

Prop
ValueDescription
defaultA standard menu action.
destructiveA dangerous action such as delete or remove.

ContextMenuLinkItem

Menu item that renders as an anchor (<a>) for navigation links. Wraps Base UI's ContextMenu.LinkItem.

Prop

ContextMenuLabel

Prop

ContextMenuGroupLabel

Prop

ContextMenuSubTrigger

Prop

ContextMenuSubContent

Prop

Additional Props

ContextMenu components inherit all props from Base UI Context Menu, including open, defaultOpen, onOpenChange, positioning options, and accessibility props.