Context Menu Component

Capsule-styled context menus with orbit hover effects and clean animations.

Basic Context Menu

Right-click on the area below to open the context menu.

Right click here

Multi-level Submenus

Context menus can contain nested submenus for organizing related actions.

Right click for nested menus

Card Item Actions

A context menu for card-based content with quick actions.

Project Proposal.pdf

Edited 2 hours ago

With Checkbox Items

Toggle visibility options using checkbox menu items.

Right click for view options

Status Bar: Visible

Activity Bar: Hidden

Panel: Hidden

With Radio Items

Select from mutually exclusive options using radio menu items.

Right click to change font size

Current: medium

API Reference

Context Menu is built on @radix-ui/react-context-menu with Capsule styling and animations.

ContextMenu

Root component that wraps context menu functionality.

PropTypeDefaultDescription
childrenReactNode-Menu content and trigger

ContextMenuTrigger

Element that triggers the context menu on right-click.

PropTypeDefaultDescription
childrenReactNode-Content to right-click on

ContextMenuContent

Container for menu items.

PropTypeDefaultDescription
align"start" | "center" | "end""start"Horizontal alignment
side"top" | "right" | "bottom" | "left""bottom"Preferred side to display menu
childrenReactNode-Menu items

ContextMenuItem

Individual menu item.

PropTypeDefaultDescription
variant"default" | "destructive""default"Visual style of the item
disabledbooleanfalseDisable the menu item
onSelect() => void-Callback when item is selected
childrenReactNode-Item content

ContextMenuCheckboxItem

Menu item with checkbox state.

PropTypeDefaultDescription
checkedbooleanfalseWhether the checkbox is checked
onCheckedChange(checked: boolean) => void-Callback when checked state changes
childrenReactNode-Item content

ContextMenuRadioGroup

Container for radio items with exclusive selection.

PropTypeDefaultDescription
valuestring-Currently selected value
onValueChange(value: string) => void-Callback when selected value changes

ContextMenuRadioItem

Individual radio option within a radio group.

PropTypeDefaultDescription
valuestring-Value of this radio option
childrenReactNode-Option label

ContextMenuSeparator

Visual divider between menu items.

No props required. Use as a self-closing component.

ContextMenuSub

Container for nested submenu.

Wrap ContextMenuSubTrigger and ContextMenuSubContent as children.

ContextMenuSubTrigger

Menu item that opens a submenu.

PropTypeDefaultDescription
insetbooleanfalseAdd left padding for icon alignment
childrenReactNode-Trigger content

ContextMenuSubContent

Container for submenu items.

PropTypeDefaultDescription
childrenReactNode-Submenu items

ContextMenuLabel

Non-interactive label for grouping menu items.

PropTypeDefaultDescription
insetbooleanfalseAdd left padding for icon alignment
childrenReactNode-Label text

ContextMenuShortcut

Display keyboard shortcut hint in menu item.

PropTypeDefaultDescription
childrenReactNode-Shortcut text (e.g., "Ctrl+C")