Dropdown Composition

Actions on a thing — the row-actions menu, the account menu. Typeahead, roving focus, grouping, and dismissal are Base UI's; the surface, the separator rhythm, and the danger tone are ours.

Usage

tsx
<Dropdown  trigger={<Button variant="outline">Actions</Button>}  items={[    { label: 'Rename', icon: <FileText size={14} />, shortcut: '⌘R' },    { separator: true },    { label: 'Delete', icon: <Trash2 size={14} />, tone: 'danger' },  ]}/>

Do

Put the destructive item last, behind a separator, and give it tone='danger'.

Don't

Use a menu for navigation between pages — a menu hides where you can go behind a click.

Props

PropTypeDefaultNotes
triggerReactElementRendered as the trigger, so your Button stays your Button.
items / sectionsMenuItem[] / MenuSection[]Use items for one action set, or labelled sections when an app menu combines distinct action kinds.
side / alignSide | Align'bottom' / 'end'Preferred placement; it flips when there is no room.

Keyboard

KeyBehaviour
Enter / Space / Opens
/ Moves the highlight, skipping disabled items
TypingJumps to the first matching item
EscCloses and returns focus to the trigger