DropdownMenu

Dropdown menus with menu / menuitem semantics, arrow-key and Home / End navigation, typeahead and managed focus. Supports plain, checkbox, radio, grouped and nested items, plus icons and shortcut hints.

Props

PropTypeDefaultDescription
openboolean—Controlled open state
defaultOpenbooleanfalseInitial open state when uncontrolled
onOpenChange(open: boolean) => void—Called whenever the open state changes
placement'top' | 'bottom' | 'left' | 'right''bottom'Preferred side: top / bottom / left / right
align'start' | 'center' | 'end''start'Cross-axis alignment: start / center / end
offsetnumber4Distance from the trigger
DropdownMenu.TriggerButtonHTMLAttributes—Trigger element; arrow keys open the menu too, asChild merges onto the only child
Trigger.asChildbooleanfalseSkip the built-in button and merge behaviour onto the only child
DropdownMenu.ContentHTMLAttributes—The menu container, role="menu"
DropdownMenu.ItemButtonHTMLAttributes—A menu item, role="menuitem", closes the menu on select
onSelect(event) => void—Called on select; call event.preventDefault() to keep the menu open
disabledboolean—Disabled item, skipped by keyboard navigation
dangerboolean—Destructive actions such as delete render in the danger colour
DropdownMenu.CheckboxItemButtonHTMLAttributes—A checkable item, role="menuitemcheckbox", stays open after toggling
CheckboxItem.checkedboolean—Controlled checked state
CheckboxItem.defaultCheckedbooleanfalseInitial checked state when uncontrolled
CheckboxItem.onCheckedChange(checked: boolean) => void—Called whenever the checked state changes
DropdownMenu.RadioGroupHTMLAttributes—A group of radio items, role="group"
RadioGroup.valuestring—Controlled selected value
RadioGroup.defaultValuestring—Initial selected value when uncontrolled
RadioGroup.onValueChange(value: string) => void—Called whenever the selected value changes
DropdownMenu.RadioItemButtonHTMLAttributes—A radio item, role="menuitemradio", stays open after selecting
RadioItem.valuestring—This item value, matched against the RadioGroup value
DropdownMenu.Subobject—Submenu root, manages its own open state
DropdownMenu.SubTriggerButtonHTMLAttributes—The submenu trigger, aria-haspopup, opens on hover or arrow keys
DropdownMenu.SubContentHTMLAttributes—The submenu container, opens to the right by default
DropdownMenu.GroupHTMLAttributes—A group container, role="group", accepts an aria-label
DropdownMenu.LabelHTMLAttributes—A group label
DropdownMenu.SeparatorHTMLAttributes—A divider between groups
DropdownMenu.ShortcutHTMLAttributes—A trailing shortcut hint such as ⌘K