Prodular UI

Dropdown menu

A list of actions or options that opens from a button, with groups, shortcuts, submenus, checkboxes and radio items.

npx prodular-ui add dropdown-menu

Account menu

Groups, shortcuts, a submenu and a destructive item at the end.

Display options

Radio items for one choice, checkbox items for many. closeOnClick false keeps the menu open while toggling.

Anatomy

<DropdownMenu>  <DropdownMenuTrigger render={<Button variant="outline" />}>Options</DropdownMenuTrigger>  <DropdownMenuContent className="w-56">    <DropdownMenuGroup>      <DropdownMenuLabel>Issue</DropdownMenuLabel>      <DropdownMenuItem>        <CopyIcon />        Duplicate        <DropdownMenuShortcut>⌘D</DropdownMenuShortcut>      </DropdownMenuItem>    </DropdownMenuGroup>    <DropdownMenuSeparator />    <DropdownMenuItem variant="destructive">      <Trash2Icon />      Delete    </DropdownMenuItem>  </DropdownMenuContent></DropdownMenu>

Guidance

Use it when

  • Use for actions on an object (Edit, Duplicate, Archive) or for view options behind one button.
  • Use checkbox items for independent toggles and radio items for a single choice.

Avoid

  • Choosing a value in a form. Use Select or Combobox.
  • More than about 12 items. Split them into groups or a submenu, or use Command.
  • Navigation between pages. Use Navigation menu or Sidebar.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Give every item a verb or a destination as its label. Put the icon first, then the label, then DropdownMenuShortcut.
  • Use variant="destructive" on the item that deletes or signs out, and put it last, after a separator.
  • Group related items with DropdownMenuGroup and a DropdownMenuLabel in sentence case. Labels must be inside a group.
  • Icons are 16px and muted automatically. Do not add size or color classes to them.
  • Open from DropdownMenuTrigger with render={<Button />}. Icon only triggers need aria-label.
  • Set a width on DropdownMenuContent with w-56 or similar. It never gets narrower than the trigger.
  • Pass closeOnClick={false} on checkbox items when people usually toggle several at once.

API

DropdownMenuContent

PropTypeDefaultDescription
align"start" | "center" | "end""start"Alignment against the trigger.
side"top" | "right" | "bottom" | "left""bottom"Preferred side.

DropdownMenuItem

PropTypeDefaultDescription
variant"default" | "destructive""default"destructive colors the item and its hover state.
insetbooleanfalseIndents the label to line up with items that have icons.

DropdownMenuCheckboxItem

PropTypeDefaultDescription
checked / onCheckedChangeboolean / (checked: boolean) => voidControlled check state.

DropdownMenuRadioGroup

PropTypeDefaultDescription
value / onValueChangestring / (value: string) => voidControlled selection for radio items.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add dropdown-menu# or, with the registry in components.jsonnpx shadcn@latest add @prodular/dropdown-menu