Skip to content
Design System
GitHub

Input OTP

v0.15.0Beta

A one-time code or PIN, one 44 px box per character, with paste and SMS autofill.

Input otp six digits

Install
npx shadcn add @syncrobotic/input-otp

Also installs: input-otp, lucide-react, @syncrobotic/cn

Overview

Boxes for a short code typed one character at a time: a verification code, a pairing code, a PIN.

When to use

  • Two-step sign-in and verification codes.
  • Pairing a robot with a code from its screen.
  • A short PIN to release a stop.

Use something else

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Input otp with separator

Pairing code on the robot's screen

Letters and numbers, as shown on Patrol dog 7F3A.

Input otp pairing code

Input otp pin

4
8
2
9
1
3

Input otp filled

Enter the 6-digit codeWe sent it to •••• 2913. It expires in 10 minutes.

Input otp verify

Usage rules

  • One real input underneath: paste and SMS autofill work.
  • Say where the code was sent and when it expires.
  • Show the error under the boxes, not in a toast.

Changelog

  • 0.15.02026-11-19A full code no longer changes when you keep typing: input-otp kept the last character selected, so each key swapped the last box. Backspace, select-all and paste still edit. On a phone a long code's boxes give a few px each instead of overflowing.
  • 0.10.02026-11-18Disabled keeps its words readable: a grey field (bg-muted, muted text) on controls with a surface, solid disabled ink on items and icons; no more 50 % opacity, which washes text out in sunlight.
  • 0.9.02026-11-17New.

How to upgrade