Skip to content

SwissPostalCodeInput

Enter a four-digit Swiss postal code.

alpina-ui/swiss/swiss-postal-code-input

Interactive preview

Shipping

Parcel label

CH
Destination postcode6900
Enter four digits.

Usage notes

A full-field paste accepts four digits, full-width digits or a CH-prefixed postal code. The submitted four-digit value preserves leading zeros.

When to use

Collect a Swiss four-digit postal code as a text identifier, including when another field will capture the locality.

When to avoid

Use an international postal address field for addresses whose codes can contain letters.

Accessibility

Associate a visible label and four-digit hint with the input. Keep format errors next to it and leave the value available for correction.

Keys
KeyAction
DigitsEnter the four-digit postal code.
Ctrl+V / ⌘VPaste the code. A full-field paste can include the CH prefix.

Content

Use PLZ or NPA where familiar and spell out the instruction in plain language. A sample code is four digits without separators.

Use
Postal code · 3000
Avoid
Location number (integer)

Copy in four languages

German
Postleitzahl (vier Ziffern)27 characters
French
NPA (quatre chiffres)21 characters
Italian
NPA (quattro cifre)19 characters
Romansh
Numer postal (quatter cifras)29 characters
Add to your project
npx --no-install alpina add swiss-postal-code-input