Dropdown
Action menu triggered by click
Menu that opens on click with keyboard navigation.
Usage
Items
Each item can have a label, icon, click handler, and states.
Alignment
Start
Default alignment to the left.
End
Align to the right.
Features
- Closes on outside click
- Closes on
Escapekey - Keyboard navigation with arrow keys
Enterto select item- Disabled items are not selectable
- Danger styling for destructive actions
Props
Dropdown
| prop | type | default | description |
|---|---|---|---|
| trigger | ReactNode | required | Element that opens the menu |
| items | (DropdownItem | "separator")[] | required | Menu items |
| align | "start" | "end" | "start" | Horizontal alignment |
DropdownItem
| prop | type | default | description |
|---|---|---|---|
| label | string | required | Item text |
| icon | ReactNode | - | Optional icon |
| onClick | () => void | - | Click handler |
| disabled | boolean | false | Disable interaction |
| danger | boolean | false | Destructive action styling |