DropdownMenu
Dropdown menu with trigger and content; requires PopoverProvider in layout.
Installation
Add the DropdownMenu component using the CLI:
Usage
The DropdownMenu component displays a menu triggered by a button or custom trigger. Use DropdownMenuTrigger with AsChild to render a custom trigger (e.g., Button), DropdownMenuContent for the panel, and DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, and DropdownMenuSeparator to structure the menu. Requires PopoverProvider in your layout (already present in the docs).
Avatar
An account switcher dropdown triggered by an avatar. Use DropdownMenuTrigger with AsChild="true" and pass an Avatar as the trigger.

Complex
A richer example combining groups, icons, shortcuts, a checked state, and a destructive action.
Checkbox Items
Use DropdownMenuCheckboxItem for togglable options. Checkbox items do not close the menu on selection, allowing multiple toggles.
Notifications: On
Sound: Off
Dark mode: Off
Radio Items
Use DropdownMenuRadioGroup with DropdownMenuRadioItem for mutually exclusive selections. Radio items close the menu on selection.
Selected: medium
API Reference
DropdownMenu
Root container for a dropdown menu; requires PopoverProvider in layout.
Properties
| Name | Type | Description |
|---|---|---|
ChildContent |
RenderFragment |
The trigger and content of the dropdown menu. |
Methods
| Method | Returns | Description |
|---|---|---|
Equals |
bool |
|
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |