Skip to content
Playground

Context Menu

A pointer and keyboard menu opened from a contextual gesture.

A pointer and keyboard menu opened from a contextual gesture.

Backed by Base UI Context Menu for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.

Right-click this card
TSX
import { ContextMenu } from "@zentara-co/zenos-ui";

Use Context Menu for actions associated with a specific surface. Keep important actions available elsewhere because contextual gestures are less discoverable than visible controls.

Checkbox items manage independent options. Radio items belong to a group and select one value.

Right-click for view options

Shortcut text communicates an existing application command. It does not register the keyboard handler.

Right-click for project actions

Context menus and submenus fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically.

Right-click each card. The first menu animates in and out. disableMotion makes the second appear and disappear immediately.

Right-click for motion
Right-click without motion

Every compound part accepts className. Style the trigger directly, then style ContextMenu.Content separately because the popup is rendered in a portal. Stable data-slot attributes and Base UI’s data-highlighted state can target items, labels, separators, and shortcuts without replacing menu behavior.

Right-click the project card
ContextMenu.Root
ContextMenu.Trigger
ContextMenu.Content
ContextMenu.Item
ContextMenu.CheckboxItem
ContextMenu.RadioGroup
ContextMenu.RadioItem
ContextMenu.Sub
ContextMenu.Separator
ContextMenu.Shortcut

API

PropTypeDefaultDescription
open boolean — Controlled open state.
defaultOpen boolean false Initial uncontrolled state.
onOpenChange (open: boolean, eventDetails) => void — Runs when visibility changes.
side / align Base UI position values — Popup placement supplied on Content.
Content.disableMotion boolean false Disables enter and exit motion on Content or SubContent.
checked / onCheckedChange boolean / (checked: boolean, eventDetails) => void — Controls a CheckboxItem selection.
value / onValueChange string / (value: string, eventDetails) => void — Controls the selected RadioGroup item.
disabled boolean false Prevents an item from receiving selection.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Base UI supplies menu roles, roving focus, typeahead, disabled semantics, and dismissal. A focused trigger can open the menu with the platform context-menu key or Shift+F10; arrow keys move through items and Escape closes it. Do not make a context menu the only path to essential functionality.