DropdownMenu

Action menu with items, labels, separators, and keyboard navigation. Compound component.

Example

Props

NameTypeDefaultRequiredDescription
openbooleanNoControlled open state
defaultOpenbooleanfalseNoInitial state (uncontrolled)
onOpenChange(open: boolean) => voidNoCalled when open state changes
anchorAnchor'bottom'NoPosition and alignment relative to trigger (e.g. bottom-right)
asChildbooleanfalseNoOn DropdownMenuTrigger — merges trigger props onto the child element. On DropdownMenuItem — merges menuitem props onto the child (e.g. <a> for navigation links)
onSelect() => voidNoOn DropdownMenuItem — called when the item is selected
disabledbooleanfalseNoOn DropdownMenuItem — disables the item and skips it in keyboard navigation

Accessibility

  • role="menu" with role="menuitem" on items
  • Arrow key navigation through items
  • Enter/Space to select, Escape to close
  • aria-expanded on trigger

Related Tokens

--dropdown-surface--dropdown-on-surface--dropdown-border--dropdown-item-margin-x