DropdownMenu
Overlayshadcn/uiA menu of actions that opens from a button: 'Edit', 'Duplicate', 'Delete'. For choosing a value use Select.
When to use
- Put the destructive item last, after a separator.
- Keep it under eight items; group with DropdownMenuLabel.
- Don't use it on mobile for main actions; use Sheet side='bottom'.
- Don't nest menus more than one level.
Accessibility
- Role
- menu / menuitem
- Keyboard
- Enter, Space or ArrowDown opens it. Arrow keys move, typing jumps to an item. Esc closes and returns focus.
- Notes
- An IconButton trigger needs its label, e.g. 'More actions'.
Props
align= 'center''start' | 'center' | 'end'On DropdownMenuContent; use 'end' for a trigger at the right edge.
onSelect(event: Event) => voidOn DropdownMenuItem.
variant= 'default''default' | 'destructive'On DropdownMenuItem.
Prompt for your agent
Use the UnbuiltUI DropdownMenu. Call unbuilt_get_component("DropdownMenu") first and follow its spec: variants, states, usage rules and accessibility.
unbuilt_get_component returns
2 variants3 states3 props4 usage rules4 a11y notes10 tokens1 example
Add it with shadcn
$
npx shadcn add https://unbuiltui.com/r/dropdown-menu.jsonTokens · 10
bg.raisedbg.subtlefg.mutedfg.subtledanger.defaultdanger.subtleborder.subtleradius.mdradius.smshadow.raised