LifeDS

Component

Input OTP

Accessible one-time password component, built on top of the input-otp library.

InputOTPmaxLength · pattern · value/onChange · disabled
InputOTPGroupwraps a set of slots
InputOTPSlotindex — individual character cell
InputOTPSeparatorvisual divider between groups
Playground

Basic

6 digits — pre-filled
1
2
3
4
5
6

Sizes

size="xl" (default) — 44px, matches Button xl height
size="default" — 32px

Pattern

digits only — REGEXP_ONLY_DIGITS
alphanumeric — REGEXP_ONLY_DIGITS_AND_CHARS

Separator — grouped

two groups of 3

Disabled

pre-filled and disabled
1
2
3
4
5
6

Controlled

Enter your one-time password.

Invalid state

aria-invalid — error styling
1
2

Four digits — PIN

digit-only, 4 slots

Form integration — verification card

Verify your identity
Enter the 6-digit code sent to your phone.

RTL support

Arabic

Tokens used

5 semantic tokens consumed by this component.

--inputInput
bg-inputborder-input
--ringRing
ring-ringring
--destructiveDestructive
bg-destructivetext-destructiveborder-destructivering-destructive
--foregroundForeground
text-foreground
--muted-foregroundMuted Foreground
text-muted-foreground