Dropdown Menu

A menu of actions or options opened from a button.

Installation

  1. Add the registryOnce per project
  2. Add dropdown-menu

Usage

Handle an item with onClick. DropdownMenuShortcut only displays a shortcut, so bind the keys yourself. Keep each DropdownMenuLabel inside a DropdownMenuGroup.

Items also take variant="destructive" and disabled.

Composition

Examples

Icon trigger

Give an icon-only trigger an aria-label. align="end" lines the menu up with its right edge.

Checkbox items

DropdownMenuCheckboxItem toggles a setting with checked and onCheckedChange.

Radio items

Wrap DropdownMenuRadioItems in a DropdownMenuRadioGroup to pick one of several options.

Nest a menu with DropdownMenuSub, DropdownMenuSubTrigger and DropdownMenuSubContent.

Props

Items, labels and submenu triggers take inset to line up with items that have an icon.

The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.