Overlay
ContextMenu
A menu that opens at the pointer on right-click, and from the keyboard with Shift+F10 or the menu key. Arrow keys move between items, Enter activates, and Escape closes it.
ReactVueWeb Components
View in Storybook Playground
Examples
<ContextMenu
menu={
<>
<ContextMenu.Item onSelect={cut}>切り取り</ContextMenu.Item>
<ContextMenu.Divider />
<ContextMenu.Item onSelect={remove}>削除</ContextMenu.Item>
</>
}
>
<div>右クリックで操作</div>
</ContextMenu> Props
| Name | Type | Default | Description |
|---|---|---|---|
children required | ReactNode | — | The trigger area; right-clicking (or Shift+F10) within it opens the menu. |
menu required | ReactNode | — | Menu items (use `ContextMenu.Item` / `ContextMenu.Divider`). |
open | boolean | — | Controlled open state. |
defaultOpen | boolean | false | Initial open state (uncontrolled). @default false |
onOpenChange | (open: boolean) => void | — | Called when the open state changes. |
className | string | — |
Accessibility
- Body/background contrast is ≥ 7:1 (AAA) in both light and dark.
- Every interaction works with the keyboard alone.
- The focus ring is always visible.
- Respects prefers-reduced-motion and stops excessive motion.
Every component is designed to meet WCAG 2.1 AAA.