DropdownMenu
A trigger button that opens a floating menu of actions with arrow-key navigation, typeahead, separators, and disabled items.
Installation
npx dafink-ui add dropdown-menuDemo
Props
| Name | Type | Default | Description |
|---|---|---|---|
| items | DropdownMenuEntry[] | - | Array of items ({ label, onSelect?, disabled? }) and separators ({ separator: true }). |
| trigger | ReactNode | - | Content of the built-in trigger button. |
| side | 'top' | 'right' | 'bottom' | 'left' | 'bottom' | Which side of the trigger the menu appears on. |
| align | 'start' | 'center' | 'end' | 'start' | Alignment along the chosen side. |
| onSelect | (item: DropdownMenuItem) => void | undefined | Called with the activated item, in addition to the item's own onSelect. |
| disabled | boolean | false | Disables the trigger. |
| className | string | '' | Additional classes on the menu list. |
| triggerClassName | string | '' | Additional classes on the trigger button. |