Skip to content

AhvInput

Check the Swiss social insurance number and its EAN‑13 checksum.

alpina-ui/swiss/ahv-input

Interactive preview

13 digits, beginning with 756

Usage notes

Accept 13 digits beginning with 756. The component validates the EAN‑13 check digit and groups a valid number on blur. Set locale for validation in any Swiss national language or supply validationMessage.

When to use

Collect a Swiss social insurance number in a workflow that requires the personal identifier and its check digit.

When to avoid

Use UidInput when identifying a Swiss enterprise and a separate reference for a customer account.

Accessibility

Provide the expected grouped format in a persistent hint and support pasting all digits. Use synthetic numbers in shared examples.

Keys
KeyAction
Tab / Shift+TabEnter or leave the field. A valid identifier is formatted when focus leaves.
Text editingType, select, paste and correct the value with the platform’s editing keys.

Content

Use the local name of the social insurance number. Give the 756 prefix and grouping once in the hint.

Use
Social insurance number · 756.xxxx.xxxx.xx
Avoid
Enter identity code here

Copy in four languages

German
AHV-Nummer10 characters
French
Numéro AVS10 characters
Italian
Numero AVS10 characters
Romansh
Numer AVS9 characters
Add to your project
npx --no-install alpina add ahv-input