Dropdown Menu
Group secondary actions. Save screen space. Keep UI clean.
Installation
pnpm dlx nachui add dropdown-menuAnatomy
Composition
Use the following composition to build a
DropdownMenu:Variants
Checkboxes
Radio Group
API Reference
DropdownMenu
| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | false | Initial open state |
onOpenChange | (open: boolean) => void | - | Callback when open state changes |
className | string | - | Additional CSS classes |
DropdownMenu.Trigger
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render as child element |
className | string | - | Additional CSS classes |
DropdownMenu.Content
| Prop | Type | Default | Description |
|---|---|---|---|
align | 'start' | 'center' | 'end' | 'start' | Horizontal alignment |
sideOffset | number | 6 | Distance from trigger |
className | string | - | Additional CSS classes |
DropdownMenu.Item
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disable the item |
variant | 'default' | 'destructive' | 'default' | Visual style |
onSelect | () => void | - | Callback when selected |
className | string | - | Additional CSS classes |
DropdownMenu.Label
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Label text |
DropdownSeparator
Visual separator between menu items.
No props - renders a horizontal line.
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.