SwissLocalityCombobox
Find a Swiss locality by postcode or name and return its municipality, BFS number and canton.
alpina-ui/swiss/swiss-locality-comboboxType 6900, Viganello or Zuerich. Each suggestion names its political municipality.
- Selection
- No locality selected
Usage notes
Type a postcode, a locality or a municipality, with or without accents. Up and Down move through the suggestions, Enter commits one and Escape restores the committed locality. With a name, the form submits name.postalCode, name.locality, name.municipality, name.bfsNumber and name.canton.
When to use
Find a locality from its postcode or name and keep its political municipality, BFS number and canton with the choice.
When to avoid
Use SwissPostalCodeInput alone when an address only needs the four digits and the locality is typed separately.
Accessibility
Keep the visible label, announce an empty search in the popup and let people review the municipality before they commit with Enter.
| Key | Action |
|---|---|
| Type | Search postcodes, localities and municipalities. |
| ↑ / ↓ | Move through the suggestions. |
| Enter | Commit the active suggestion. |
| Escape / Tab | Close the suggestions and keep the committed locality. |
Content
Ask for the postcode or locality in one short hint. Show the municipality next to each suggestion because several towns share one postcode.
- Use
- Postcode or locality
- Avoid
- Enter geographic object identifier
Copy in four languages
- German
- PLZ oder Ort12 characters
- French
- NPA ou localité15 characters
- Italian
- NPA o località14 characters
- Romansh
- NPA u lieu10 characters
npx --no-install alpina add swiss-locality-combobox