Atomx Docs
Components

Dropdown Menu

A menu of actions or options anchored to a trigger button, built on Radix UI's DropdownMenu primitive — with items, labels, separators, shortcuts, checkboxes, radio groups, and sub-menus.

Install

npx shadcn@latest add https://atomx.acau.net/r/dropdown-menu.json

Usage

Use Dropdown Menu for a set of actions or options revealed from a button — account menus, row actions, "more" overflow menus. Reach for Select instead when the user is picking a single value for a form field, and Context Menu when the menu should open on right-click rather than from a visible trigger.

Wrap the trigger element in DropdownMenuTrigger (use asChild to render your own button) and place the menu items inside DropdownMenuContent. Use DropdownMenuLabel for section headings and DropdownMenuSeparator between groups.

<DropdownMenu>
  <DropdownMenuTrigger asChild>
    <Button variant="outline">Open menu</Button>
  </DropdownMenuTrigger>
  <DropdownMenuContent>
    <DropdownMenuLabel>My Account</DropdownMenuLabel>
    <DropdownMenuSeparator />
    <DropdownMenuItem>Profile</DropdownMenuItem>
    <DropdownMenuItem>Settings</DropdownMenuItem>
  </DropdownMenuContent>
</DropdownMenu>

Preview

Props

ComponentNotable props
DropdownMenuTriggerAny element. asChild to render the child as the trigger.
DropdownMenuContentsideOffset (default 4), align, className for width/positioning overrides.
DropdownMenuIteminset — left-indent to align with items that have icons. onSelect — called when clicked. disabled.
DropdownMenuLabelinset — matches DropdownMenuItem indent.
DropdownMenuSeparatorHorizontal divider.
DropdownMenuShortcutRight-aligned keyboard hint span.
DropdownMenuCheckboxItemchecked, onCheckedChange.
DropdownMenuRadioGroup / DropdownMenuRadioItemvalue / onValueChange for mutually exclusive choices.
DropdownMenuSub / DropdownMenuSubTrigger / DropdownMenuSubContentNested sub-menu.