v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
ContextMenu
Contextual actions with a visible button alternative.
Interactive preview
Usage
import { ContextMenu } from "@devvy-ui/react";
<ContextMenu label="Card actions" items={actions}><p>Project card</p></ContextMenu>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| items | MenuAction[] | required | Context actions. |
| label | string | required | Accessible action-menu name. |
| open / onOpenChange | boolean / callback | local | Optional controlled visibility. |
Accessibility & behavior
Platform Behavior & Guidelines
Context click or Shift+F10 opens the action list. The permanent button provides a discoverable touch and keyboard path; actions use the same menu behavior.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add context-menuMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
ContextMenu.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.