v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

ContextMenu

Contextual actions with a visible button alternative.

Interactive preview

Orbit workspace · Right click or use the actions button.

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:

PropTypeDefaultDescription
itemsMenuAction[]requiredContext actions.
labelstringrequiredAccessible action-menu name.
open / onOpenChangeboolean / callbacklocalOptional 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-menu

Make 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.