OtpInput
v1.0.1Updated 20 Jul 2026Multi-cell digit / alphanumeric verification-code input built on the shadcn input-otp primitive. Configurable length and groups, paste support, auto-submit on complete, optional resend countdown (mm:ss), and three size s
Preview
Live · 10 storiesDefaultOpen ↗
▸Why this is recommendedformotpverificationcode+7
The default, out-of-the-box OtpInput.
Recommended for+14
- ✓Two-factor / MFA verification
- ✓Email or SMS verification
- ✓Magic-link backup code entry
Tags+6
formotpverificationcode2famfacellsinputverification codecode inputdefault
Features+4
- Configurable cell count + visual grouping
- Numeric or alphanumeric mode
- Paste full code support
- Auto-submit on complete (onComplete)
- Resend countdown timer (mm:ss) with cooldown
- Error state with red ring
- Three size scales (sm / md / lg)
Not recommended for−2
- ✕Long free-text codes (use Input)
- ✕Password entry (use PasswordInput)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
PropTypeRequired
valueControlled code
—onValueChangeValue callback
—lengthCell count (default 6)
—groupsCell grouping (default [3, 3])
—typeAllowed chars
—autoSubmitFire onComplete when full
—onCompleteFires when all cells filled
—resendableShow resend button + countdown
—resendCooldownSecondsCooldown (default 30)
—onResendResend callback
—sizeCell size
—errorError message
—