v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

DropdownMenu

Actions with keyboard navigation and typeahead.

Interactive preview

Usage

import { DropdownMenu } from "@devvy-ui/react";

<DropdownMenu label="Project actions" items={[{ id: 'save', label: 'Save project', onSelect: save }]} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
itemsMenuAction[]requiredUnique ids, labels, callbacks and optional disabled/shortcut.
labelstringrequiredTrigger/menu accessible name.

Accessibility & behavior

Platform Behavior & Guidelines

Arrow keys, Home/End and typeahead move focus among enabled menu items. Escape returns to the trigger. Actions close the menu.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add dropdown-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.

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