Zephora UI

Navigation

ContextMenu

Right-click menu anchored to the pointer position, driven by a declarative array of actions and separators.

Import

import { ContextMenu } from "@zephora/react";

Examples

Basic

Right-click (or long-press) the area to open the menu.

Right-click here

Last action: none

Disabled and danger entries

File.txt — right-click

API

ContextMenu props

PropTypeDefaultDescription
content *ContextMenuEntry[]Menu entries: actions, nested submenus and separators (see the entry table below).
onSelect(value: string) => voidCalled with the picked entry's value.
childrenReactNodeThe right-clickable target area.
disabledbooleanfalseDisables opening the menu.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

ContextMenuEntry props

PropTypeDefaultDescription
label *stringEntry label.
valuestringReported to onSelect. Optional for entries that only open a submenu.
disabledbooleanDisables the entry.
dangerbooleanDestructive styling.
iconReactNodeElement rendered before the label.
shortcutstringKeyboard shortcut hint rendered at the end.
itemsContextMenuEntry[]Nested entries — renders this entry as a submenu (arbitrary depth).
separatortruePass { separator: true } as an entry to render a divider instead.

Keyboard

KeyAction
ArrowDown / ArrowUpMove the active item through enabled entries.
Home / EndJump to the first / last enabled entry.
Enter / SpacePicks the active entry and closes the menu.
ArrowRight / ArrowLeftOpens / closes the focused submenu level.
Escape / TabCloses the menu.