Loading
Loading
Loading
mobile footer

Build the Interaction Layer Your Website is Missing.

Browse All EffectsBrowse All EffectsBrowse All EffectsUpgrade to ProUpgrade to ProUpgrade to Pro

80+ effects free, forever. No credit card.

© 2026 Hyperiux. All Rights Reserved.

AI Component CatalogueHey AI, Learn About Us
Platform

Vault

  • Documentation
  • Pricing
  • Blog
  • Community
  • NPM
  • MCP

Categories

  • All Effects
  • WebGL
  • Text
  • Backgrounds
  • Buttons
  • Carousels
  • Scroll
  • Components
  • Navigation
  • Cursor
  • Transitions
  • Loaders

Documents

  • Introduction
  • Installation
  • CLI
  • Dependencies
  • License

Legal

  • License Agreement
  • Terms of Service
  • Privacy Policy
  • Refund Policy
Socials
  • Twitter / X
  • LinkedIn
  • GitHub
  • Instagram
Contact Us
  • hello@hyperiux.com
New effects, in your inbox

Every new drop, plus the occasional behind-the-scenes build. No spam. Unsubscribe anytime.

Loading
Home/Input OTP Component

Input OTP Component

An animated one-time password input with flowing focus indicators, character transitions, paste handling, and clear verification feedback for secure authentication workflows.

@base-ui/reactclass-variance-authorityinput-otplucide-reactmotiontailwind-merge
DemoDemoDemo

Tune the Real Props

Overview

Input OTP gives each character its own slot, with a moving focus indicator and animated character entrances. Pasting a full code fills every slot at once, invalid characters are rejected, wrong codes shake with an error, and a successful check plays a wave across the slots before confirming.

Use it for account activation, two-factor login, password recovery, and transaction checks. Users should always know where the next character goes and whether their code worked, without animation slowing them down.


Theme and Interaction Customisation

Adjust box size, joined or separated slots, and corner roundness to fit compact or branded layouts. Motion options include focus-ring travel, pop or roll character entrances, paste stagger, error shake, and the success wave.


Example Production Use Case

A SaaS sign-up flow can show Input OTP right after registration. Users paste the code from their email, the backend checks it, and the slots wave green before the next onboarding step.

A banking app can use it to confirm a transfer, with a clear error and shake on a wrong code and a link to request a new one.

A login screen with two-factor authentication can support autofill on mobile, so the code from an SMS fills the slots in one tap.


Best Used For

  • Account registration and email or phone verification.
  • Two-factor authentication at login.
  • Password recovery.
  • Sensitive account actions like changing security settings.
  • Transaction verification.
  • Compact onboarding verification steps.

Not For

It isn’t for passwords, long credentials, or general text, since slots suit only short codes.

Don’t add OTP verification where no extra identity check is needed, because it only adds friction.

It doesn’t replace stronger options like passkeys, and it must never show success before the backend confirms the code.


Performance Budget

Update input values immediately and keep character animations to short transforms and fades. Paste must fill the real value without waiting for stagger, and error or success animations should never delay correction or progression.


Accessibility and Mobile

Treat the slots as one labelled field, with predictable typing, deletion, paste, and autofill, plus readable error and success messages. On mobile, keep slots readable without overflow and use autofill attributes, and with reduced motion remove entrances, focus travel, shake, and the success wave.


Common Mistakes

  • Treating a filled code as verified.
  • Delaying paste handling behind animations.
  • Accepting characters that don’t match the service’s code format.
  • Showing errors only through animation.
  • Breaking deletion, replacement, or paste behaviour.
  • Showing success before the server confirms it.
  • Ignoring reduced-motion preferences.

Changelog

v1.0.0

Oct 23, 2026
Initial release

API Reference

PropTypeDefaultDescription
themestringghibliColour palette. Any theme but Default also tints the active box, the gliding ring and the caret.
modestringdarkLight or dark version of the palette. Starts dark.
allowedCharactersstringmixedWhich characters the boxes accept; anything else is ignored as you type or paste.
glideRingbooleanfalseOne ring that slides from box to box as you type or move with the arrow keys. When off, each box just lights up on its own.
charAnimationstringpopHow each character appears in its box.
pasteStaggernumber0.05Delay between characters when a whole code is pasted, in seconds. Needs Character in set to anything but None.
shakeOnErrorbooleantrueShakes the boxes when the code is wrong or a blocked character is entered.
successWavebooleantrueA wave of the theme's success colour runs across the boxes when the code is right.
boxSizestring16Size of each box, on Tailwind's spacing scale.
joinedbooleanfalseJoins the boxes into one bar with shared borders.
roundedstringmdCorner radius of the boxes. With Joined boxes on, only the outer corners round.

Questions, Answered.

What is Input OTP?

Input OTP is a React component for entering one-time verification codes through individual slots, with animated focus, paste handling, input restrictions, and validation feedback.

Does Input OTP support pasting a complete code?

Yes. A pasted code fills the sequence, with an optional staggered visual entrance.

Can Input OTP accept letters and symbols?

Yes. An allowed-character setting supports mixed input, and it should match the verification service’s code format.

How does Input OTP show an incorrect code?

An invalid state triggers a short shake, which should always come with a readable error message.

Does Input OTP support browser autofill?

It supports autofill-oriented input, though availability depends on the browser, device, input attributes, and delivery method.

Is Input OTP secure?

It provides the entry interface only. Security depends on the verification service, including expiry, attempt limits, rate limiting, and server-side validation.

View MoreView More

Request a Custom Animation

Need a custom effect? Tell us what to create.

Related Effects

Explore All EffectsExplore All EffectsExplore All Effects
Tooltip Component
lucide-reactmotiontailwind-merge

Tooltip Component

Components

Radio Component
motion

Radio Component

Components

Hover Card Component
@base-ui/reactclass-variance-authoritylucide-react

Hover Card Component

Components

All Effects
Featured ComponentsText AnimationsAnimated BackgroundsAnimated ButtonsCarousel EffectsScroll EffectsCreative ComponentsNavigationsCursor EffectsTransitionsLoadersWebGL & 3D Effects
Templates
IntroductionInstallationCLIDependenciesLicense
PricingBlogGithubNPMMCP Doc