# Dropdown Menu

Displays a menu to the user — such as a set of actions or functions — triggered by a button.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).





<ComponentPreview name="dropdown-menu-demo">
  <DropdownMenuDemo />
</ComponentPreview>

## Installation [#installation]

<Tabs defaultValue="cli">
  <TabsList>
    <TabsTrigger value="cli">
      CLI
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add https://shadcn-cssinjs.com/r/dropdown-menu.json
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      pnpm add @base-ui/react @stylexjs/stylex
      ```

      <Step>
        Make sure [StyleX is configured](/docs/installation) and the design tokens are
        installed.
      </Step>

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource name="dropdown-menu" title="dropdown-menu.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</Tabs>

## Usage [#usage]

```tsx
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu/dropdown-menu";
```

```tsx
<DropdownMenu>
  <DropdownMenuTrigger>Open</DropdownMenuTrigger>
  <DropdownMenuContent>
    <DropdownMenuLabel>My Account</DropdownMenuLabel>
    <DropdownMenuSeparator />
    <DropdownMenuItem>Profile</DropdownMenuItem>
    <DropdownMenuItem>Billing</DropdownMenuItem>
  </DropdownMenuContent>
</DropdownMenu>
```

## Composition [#composition]

Use the following composition to build a `DropdownMenu`:

```txt
DropdownMenu
├── DropdownMenuTrigger
└── DropdownMenuContent
    ├── DropdownMenuLabel
    ├── DropdownMenuGroup
    │   └── DropdownMenuItem
    │       └── DropdownMenuShortcut
    ├── DropdownMenuCheckboxItem
    ├── DropdownMenuRadioGroup
    │   └── DropdownMenuRadioItem
    ├── DropdownMenuSeparator
    └── DropdownMenuSub
        ├── DropdownMenuSubTrigger
        └── DropdownMenuSubContent
```

## Examples [#examples]



### Basic [#basic]

<ComponentPreview name="dropdown-menu-basic">
  <DropdownMenuBasic />
</ComponentPreview>

### Submenu [#submenu]

Nest a `DropdownMenuSub` to create a submenu.

<ComponentPreview name="dropdown-menu-submenu">
  <DropdownMenuSubmenu />
</ComponentPreview>

### Shortcuts [#shortcuts]

<ComponentPreview name="dropdown-menu-shortcuts">
  <DropdownMenuShortcuts />
</ComponentPreview>

### Icons [#icons]

<ComponentPreview name="dropdown-menu-icons">
  <DropdownMenuIcons />
</ComponentPreview>

### Checkboxes [#checkboxes]

Use `DropdownMenuCheckboxItem` for toggleable options.

<ComponentPreview name="dropdown-menu-checkboxes">
  <DropdownMenuCheckboxes />
</ComponentPreview>

### Radio Group [#radio-group]

<ComponentPreview name="dropdown-menu-radio-group">
  <DropdownMenuRadioGroupDemo />
</ComponentPreview>

### Destructive [#destructive]

<ComponentPreview name="dropdown-menu-destructive">
  <DropdownMenuDestructive />
</ComponentPreview>

### Complex [#complex]

<ComponentPreview name="dropdown-menu-complex">
  <DropdownMenuComplex />
</ComponentPreview>



### Checkboxes Icons [#checkboxes-icons]

<ComponentPreview name="dropdown-menu-checkboxes-icons">
  <DropdownMenuCheckboxesIcons />
</ComponentPreview>

### Radio Icons [#radio-icons]

<ComponentPreview name="dropdown-menu-radio-icons">
  <DropdownMenuRadioIcons />
</ComponentPreview>

### Avatar [#avatar]

<ComponentPreview name="dropdown-menu-avatar">
  <DropdownMenuAvatar />
</ComponentPreview>



## RTL [#rtl]

To enable right-to-left support, see the [RTL guide](/docs/rtl).

<ComponentPreview name="dropdown-menu-rtl" direction="rtl">
  <DropdownMenuRtl />
</ComponentPreview>

## API Reference [#api-reference]

See the [Base UI](https://base-ui.com/react/components/menu#api-reference)
documentation for the full API.
