Installation
ReducedMotion
Pass reducedMotionwhen you want the installed component to settle into its quieter motion path immediately. Leaving the prop unset still respects the user's system-level reduced motion preference.
Props
ContextMenu
5 props
Root provider that coordinates open state and the shared motion shell used by the trigger, content, and item primitives.
children
ReactNodeRequired
Compose ContextMenuTrigger, ContextMenuContent, and item primitives such as ContextMenuItem or ContextMenuSub inside the root.
open
booleanControlled open state for the menu surface. Supported on the Base UI install.
defaultOpen
booleanDefault
falseInitial open state for uncontrolled usage on the Base UI install.
onOpenChange
(open: boolean) => voidCalled whenever the trigger, outside interaction, or Escape key changes the open state.
reducedMotion
booleanForces reduced motion for this menu instance, overriding the user system preference.
Notes
Compose ContextMenuTrigger, ContextMenuContent, and item primitives inside the root.
Current install target: Radix UI.
Dependencies declared by this registry entry: @radix-ui/react-context-menu, motion, lucide-react.
Installs the Radix context-menu primitive under the same composable ContextMenu API used by the Base UI build.
Radix handles focus, dismissal, and pointer anchoring while the menu shell keeps the original Iconiq motion treatment.
The generated registry file is /r/r-context-menu.json.
ContextMenuTrigger
3 props
Interactive surface that opens the menu on right click, long press, or keyboard context-menu shortcuts.
children
ReactNodeRequired
Trigger content rendered inside the context-click target.
asChild
booleanMerges trigger behavior onto the single child element instead of rendering a wrapper element.
className
stringMerged onto the trigger surface, including the focus ring and theme token scope.
ContextMenuContent
3 props
Portaled menu panel that renders the composed item tree with the Iconiq border, shadow, and motion treatment.
children
ReactNodeRequired
Menu body content such as groups, items, separators, checkbox rows, and nested submenus.
className
stringMerged onto the animated panel shell. Use width utilities such as w-48 when you want a fixed menu width.
collisionPadding
numberDefault
8Viewport padding used while the underlying primitive resolves collision-aware placement.
ContextMenuItem
5 props
Interactive menu row with the Iconiq active highlight, row entrance motion, and optional destructive styling.
children
ReactNodeRequired
Row content. Pair with ContextMenuShortcut when you want trailing keyboard hints.
variant
"default" | "destructive"Default
defaultSwitches the row into the destructive color treatment used for irreversible actions.
disabled
booleanDims the row and blocks pointer and keyboard selection.
inset
booleanAdds extra start padding so the row aligns with checkbox and radio items.
onSelect
(event: Event) => voidCalled when the row is activated.
ContextMenuShortcut
2 props
Trailing helper text for keyboard hints. It stays muted until the parent row is focused.
children
ReactNodeRequired
Shortcut copy such as ⌘R or Del.
className
stringMerged onto the trailing shortcut span.
ContextMenuSub
1 prop
Nested submenu root. Pair ContextMenuSubTrigger with ContextMenuSubContent to build secondary menus such as More Tools.
children
ReactNodeRequired
Submenu trigger and content parts rendered inside the parent menu.
ContextMenuCheckboxItem
4 props
Toggle row with a trailing check indicator and the same Iconiq row motion treatment as ContextMenuItem.
checked
booleanControls whether the row renders in the checked state.
onCheckedChange
(checked: boolean) => voidCalled when the row toggles between checked and unchecked.
disabled
booleanDims the row and blocks pointer and keyboard selection.
inset
booleanAdds extra start padding to align with sibling rows.
ContextMenuRadioGroup
2 props
Single-select group for ContextMenuRadioItem rows. Use ContextMenuLabel above the options when you need a section heading.
value
stringControlled selected value for the radio group.
onValueChange
(value: string) => voidCalled when a radio row is selected.