DropdownMenu
Group related actions in a keyboard-accessible menu.
alpina-ui/interactive/dropdown-menuAtelier Selva
Bellinzona · TI
Usage notes
Keep item labels actionable. Use shortcut to show a keyboard binding that the application already implements. The popup follows the visible viewport when zoom or scrolling changes it.
When to use
Collect secondary commands that act on the same selected record.
When to avoid
Use a Select to choose a stored value. Keep a frequent primary action visible outside the menu.
Accessibility
Give the trigger a purpose, support arrow-key movement and restore focus on dismiss. Identify destructive commands with words.
| Key | Action |
|---|---|
| ↓ / ↑ | Open the menu at its first or last item, then move between items. |
| Home / End | Focus the first or last item. |
| Type | Find an item by the beginning of its label. |
| Enter / Space | Activate the focused enabled item. |
| Escape | Dismiss and return focus to the menu button. |
| Tab / Shift+Tab | Dismiss and continue in document order. |
Content
Use parallel verb phrases, typically one action and one object. Give repeated menus names that include the target record.
- Use
- Actions for invoice 104 / Download invoice
- Avoid
- More / Item 1
Copy in four languages
- German
- Rechnung herunterladen22 characters
- French
- Télécharger la facture22 characters
- Italian
- Scarica fattura15 characters
- Romansh
- Telechargiar il quint21 characters
npx --no-install alpina add dropdown-menu