Overlays
ContextMenu
The menu a right-click opens.
When to reach for it
Examples
default
Notes
Radix ContextMenu root and trigger, as typed passthroughs.
Props
Takes no props of its own.
Parts
Composed at the call site rather than configured through props, so a layout this component did not anticipate is still expressible.
ContextMenuContent
The menu a right-click opens.
Never the only way to reach an action. A context menu is opened by a secondary pointer button or a keyboard's own menu key, and a meaningful share of readers have neither — a touch user, someone on a trackpad they have not configured, anyone driving the page by keyboard alone. Whatever is in here belongs somewhere reachable too: a row's overflow button, a toolbar.
Takes no props of its own.
ContextMenuItem
A row. Highlight follows data-highlighted, which covers hover and keyboard.
| Prop | Type | Default | Description |
|---|---|---|---|
| destructive | boolean | false | — |
| icon | LucideIcon | — |
Also accepts everything in ComponentProps<typeof ContextMenuPrimitive.Item>. Those are forwarded to the underlying element and are not listed row by row.
ContextMenuSeparator
Hairline divider between groups.
Takes no props of its own.
ContextMenuLabel
Mono eyebrow heading for a group.
Takes no props of its own.
Re-exports
ContextMenu = ContextMenuPrimitive.RootRadix ContextMenu root and trigger, as typed passthroughs.
ContextMenuTrigger = ContextMenuPrimitive.TriggerKeyboard
| Key | Does |
|---|---|
| ShiftF10 | Opens the menu from the keyboard, where the platform supports it. |
| ↑↓ | Moves between items. |
| Escape | Closes it. |