Components
Dropdown Menu
Displays a menu to the user — such as a set of actions or functions — triggered by a button.
Demo
Code
Open Menu
Installation
Usage
Basic Usage
With Icons
With Sub-menu
API Reference
DropdownMenu
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Content |
open | boolean | — | Controlled open state |
onOpenChange | (open: boolean) => void | — | Open state change handler |
DropdownMenuTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Trigger content |
asChild | boolean | false | Merges props with child component |
DropdownMenuContent
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Menu items |
align | 'start' | 'center' | 'end' | 'start' | Alignment relative to trigger |
side | 'top' | 'bottom' | 'bottom' | Side relative to trigger |
sideOffset | number | 4 | Distance from trigger |
className | string | — | Custom styles |
DropdownMenuItem
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Item content |
onPress | () => void | — | Press handler |
disabled | boolean | false | Disable item |
destructive | boolean | false | Style as destructive action |
leftIcon | ReactNode | — | Icon on left |
rightIcon | ReactNode | — | Icon on right |
className | string | — | Custom styles |
textClassName | string | — | Custom text styles |
DropdownMenuLabel
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Label content |
className | string | — | Custom styles |
textClassName | string | — | Custom text styles |
DropdownMenuSub
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Sub-menu content |
trigger | ReactNode | Required | The item acting as trigger |
DropdownMenuSubContent
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Sub-menu items |
sideOffset | number | 4 | Distance from trigger |
className | string | — | Custom styles |
size | 'default' | 'sm' | 'lg' | 'default' | Content size |
shadow | 'none' | 'sm' | 'md' | 'lg' | 'md' | Shadow size |