Dropdown Menu

A menu of actions displayed to the user when a trigger is activated. Supports items, checkboxes, radio groups, sub-menus, and keyboard shortcuts.

Installation

pnpm
pnpm dlx @hex-core/cli add dropdown-menu

API Reference

PropTypeDefaultDescription
open
booleanControlled open state
defaultOpen
booleanfalseDefault open state
onOpenChange
functionCallback on open state change: (open: boolean) => void
modal
booleantrueWhen true, interaction outside the menu is blocked

AI Guidance

When to use

Use for action menus triggered by a button: user menus, row-action menus, toolbar overflow. Include DropdownMenuLabel for context, DropdownMenuSeparator for grouping.

When not to use

Don't use for navigation between pages (use NavigationMenu or links). Don't use for selection inputs (use Select or Combobox). Don't use for right-click menus (use ContextMenu).

Common mistakes

  • Using DropdownMenu as a form Select (use Select instead)
  • Putting interactive elements directly in the trigger without asChild
  • Too many items without grouping (use DropdownMenuLabel + DropdownMenuSeparator)
  • Forgetting DropdownMenuShortcut for keyboard-accessible actions

Accessibility

Full keyboard navigation: arrow keys, Home, End, typeahead, Escape. Radix handles role='menu', role='menuitem', and aria-labelledby.

Related components

Token budget: 700