Dropdown Menu
stableDisplays a menu to the user — such as a set of actions or functions — triggered by a button.
Basic usage
Examples
With checkboxes and radio items
Toggle options and select an exclusive value inside a dropdown.
Rich action menu
Use labels, separators, checkbox items, radio items and shortcuts in one menu.
Features
- Can be controlled or uncontrolled.
- Supports submenus with configurable reading direction.
- Supports items, labels, groups of items.
- Supports checkable items (single or multiple).
- Customize side, alignment, offsets, collision handling.
- Focus is fully managed; full keyboard navigation; typeahead support.
Installation
bash
pnpm dlx structyl add dropdown-menuAPI Reference
Dropdown Menu API reference
Full props, types, defaults, and all 15 parts.
Keyboard interactions
Adheres to the WAI-ARIA design pattern .
| Key | Description |
|---|---|
| Space / Enter | Opens the menu and focuses the first item. |
| ArrowDown / ArrowUp | Moves focus between items. |
| ArrowRight / ArrowLeft | Opens / closes a submenu. |
| Esc | Closes the menu and returns focus to the trigger. |