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
triggerReactNodeElement that toggles the menu.
itemsDropdownEntry[]Items, { separator: true }, or { heading }.
align'start' | 'end'Edge to anchor to. Default start.
classNamestringMerged onto the wrapper.