Shadcn OTP Input Components

A one-time code input with digit, letter and custom patterns, grouped slots, masking, paste and autofill support, auto submit and form validation. Built on ui-sdk and styled with shadcn/ui theme tokens. Browse our collection of 15 Shadcn OTP Input variants.

Basic

Enter the 6 digit code we sent you.

Four digits

Four digits, separate slots.

With separator

Try pasting 123-456.

Alphanumeric

Letters and digits, like AB12-CD34.

Masked PIN

Digits are hidden as you type.

Sizes

Invalid state

Disabled and read only

Controlled with autofill

Value: empty (none)

Auto submit on complete

Submits when all digits are in. Try 123456.

Resend countdown

Didn't get it?Resend in 0:30

Form with validation

Validated with zod on submit.

Two-factor verify

Two-factor authentication
Open your authenticator app and enter the 6 digit code for Northwind.
2FA verification

Email verification

Check your email
We sent a 4 digit code to maya@acme.io.

Didn't receive it? Resend in 45s

Email verification

Phone SMS code

Enter the code
Sent by SMS to +1 (415) 555-0132

Your phone may suggest the code automatically.

Resend in 0:20
Phone sign-in
Unlock premium components
Get full control of shadcn/ui components, blocks and instances, including future additions.

Explore Shadcn Blocks

Ready-made page sections built with the same components.

View all blocks