InputOTP
Type or paste a numeric code and preserve leading zeros.
alpina-ui/interactive/input-otpEnter the six digits you received by SMS.
Usage notes
Formatted-paste handling respects read-only and disabled fields. Editable inputs retain leading zeros and normalize full-width digits.
When to use
Collect a short verification code delivered through a separate channel when every position belongs to the same value.
When to avoid
Use a password field for reusable credentials of arbitrary length.
Accessibility
Label the whole code, allow pasting and test one-time-code autofill. Explain how to request a new code when the first expires.
| Key | Action |
|---|---|
| Digits | Enter the code in one input. The visual boxes follow the same value. |
| ← / → | Move the text caret. |
| Backspace / Delete | Remove digits using native text editing. |
| Ctrl+V / ⌘V | Paste the code into the field. |
Content
State the number of digits once in the instruction. Keep delivery and expiry details in a separate sentence.
- Use
- Enter the six-digit code from your email.
- Avoid
- Fill in each box one character at a time.
Copy in four languages
- German
- Sechsstelligen Code eingeben28 characters
- French
- Saisir le code à six chiffres29 characters
- Italian
- Inserire il codice a sei cifre30 characters
- Romansh
- Endatar il code da sis cifras29 characters
npx --no-install alpina add input-otp