Skip to content

Dropdown Menu

Displays a menu of actions — opened by a trigger button.

Install

Bash
npx @madeui/cli add dropdown-menu

Usage

TSX
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuGroup,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';

Composition

TSX
<DropdownMenu>
  <DropdownMenuTrigger />
  <DropdownMenuContent>
    <DropdownMenuGroup>
      <DropdownMenuLabel />
      <DropdownMenuItem />
    </DropdownMenuGroup>
    <DropdownMenuSeparator />
  </DropdownMenuContent>
</DropdownMenu>

Disabled item

Checkbox and radio items

Radio group

Shortcuts

Destructive item

API reference

Built on Base UI Menu. The tables below cover the props this library adds or changes — every other prop is forwarded to the underlying Base UI part; see the Base UI Menu API reference for the full list.

PropTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''bottom'
sideOffsetnumber4
align'start' | 'center' | 'end''start'
alignOffsetnumber0
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.
PropTypeDefaultDescription
disabledbooleanfalse
variant'default' | 'destructive''default'
insetboolean—Indents to align with checkbox/radio item labels.
onClick(event) => void—Action to run when the item is selected.
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Base UI checkbox/radio menu items with a trailing check indicator. DropdownMenuRadioItems go inside a DropdownMenuRadioGroup (value / defaultValue / onValueChange).

Same props as DropdownMenuContent; sizes to its content (defaults sideOffset={0}, alignOffset={-4}).

Styling

DropdownMenuSeparator, DropdownMenuLabel (supports inset), and DropdownMenuShortcut accept style (StyleXStyles, merged last so caller overrides always win) plus all native props of the element they render.

DropdownMenu (Root), DropdownMenuTrigger, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, and DropdownMenuRadioGroup are Base UI parts re-exported unstyled. Keep items inside a DropdownMenuGroup; Trigger accepts render.

Was this page helpful?