Combobox
Type to filter options and use the keyboard to confirm a choice.
alpina-ui/interactive/comboboxUsage notes
Provide a clearLabel to let visitors remove a committed choice and return to search. A required field can display an inline message until a valid option is chosen.
When to use
Search a long set of permitted values, especially when people know only part of a name.
When to avoid
Offer a native select for a few familiar options. Free text without a constrained set belongs in an Input.
Accessibility
Name the input and expose its expanded state and active option. Make it clear when typed text has become a committed choice.
| Key | Action |
|---|---|
| Type | Filter available choices. |
| ↑ / ↓ | Open the list and move the active option. |
| Enter | Commit the active option. |
| Escape / Tab | Close the list. Tab also moves focus out of the field. |
Content
Name the requested entity. Use a short instruction for searching and a specific empty result that points to a next step.
- Use
- Search municipality / No matches for Luga
- Avoid
- Select / Error
Copy in four languages
- German
- Gemeinde suchen15 characters
- French
- Rechercher une commune22 characters
- Italian
- Cerca un comune15 characters
- Romansh
- Tschertgar ina vischnanca25 characters
npx --no-install alpina add combobox