Stepwise UI

Dropdown Menu

An anchored action menu that grows from its trigger. Supports icons, keyboard shortcuts, group headings, separators, destructive items, and nested submenus. Full roving-focus keyboard navigation. Closes on outside click or Escape.

Installation

npx stepwise-ui add dropdown-menu

Default

Text only

Omit icon on every item - no icon gutter is reserved, labels start flush at the leading edge.

Nested

Give an item its own items array and it becomes a submenu trigger - a trailing chevron replaces the shortcut slot, and it opens on hover, click, or →. Flips to the left edge automatically if it would overflow the viewport.

Alignment

Props

PropTypeDescription
trigger
ReactNode
Element that toggles the menu.
items
DropdownEntry[]
Items, { separator: true }, or { heading }.
align
'start' | 'end'
Edge to anchor to. Default start.
className
string
Merged onto the wrapper.
Each item accepts label, icon, shortcut, onSelect, destructive, disabled, and items (nested DropdownEntry[] - presence turns the row into a submenu trigger and its own onSelect is ignored).