Search components

Find a component by name

Input OTP

One-time password input with slots.

1
2
3
4
5
6

Pattern

Use the pattern prop to restrict what can be typed, for example REGEXP_ONLY_DIGITS from input-otp.

Separator

Use InputOTPSeparator between InputOTPGroups to split the code into chunks.

Disabled

Use the disabled prop to disable the input.

1
2
3
4
5
6

Controlled

Use value and onChange to control the input.

Enter your one-time password.

Invalid

Set aria-invalid on the InputOTPSlots to show the error state.

0
0
0
0
0
0

Four Digits

A common pattern for PIN codes: maxLength={4} with pattern={REGEXP_ONLY_DIGITS}.

Alphanumeric

Use REGEXP_ONLY_DIGITS_AND_CHARS to accept both letters and numbers.

Form

A verification card that combines InputOTP with Field, Card and Button, using larger slots for the code.

Verify your login
Enter the verification code we sent to your email address: m@example.com.

I no longer have access to this email address.

Having trouble signing in? Contact support

Installation

npx shadcn@latest add @refer/input-otp

Usage in the apps

Which apps install this component, whether their copy matches the registry, and which files import it.

PortalIn syncNot imported
ArgusDivergedNot imported
LandingIn syncNot imported
PartnersIn syncNot imported

No app imports this component. From olympus-backend@2ee40d05e, Oct 26, 2026. โ€œIn syncโ€ means the app's copy matches this registry; refresh with npm run usage:build.