
Tooltip Component
Components
An animated one-time password input with flowing focus indicators, character transitions, paste handling, and clear verification feedback for secure authentication workflows.
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.
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.
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.
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.
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.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
theme | string | ghibli | Colour palette. Any theme but Default also tints the active box, the gliding ring and the caret. |
mode | string | dark | Light or dark version of the palette. Starts dark. |
allowedCharacters | string | mixed | Which characters the boxes accept; anything else is ignored as you type or paste. |
glideRing | boolean | false | One 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. |
charAnimation | string | pop | How each character appears in its box. |
pasteStagger | number | 0.05 | Delay between characters when a whole code is pasted, in seconds. Needs Character in set to anything but None. |
shakeOnError | boolean | true | Shakes the boxes when the code is wrong or a blocked character is entered. |
successWave | boolean | true | A wave of the theme's success colour runs across the boxes when the code is right. |
boxSize | string | 16 | Size of each box, on Tailwind's spacing scale. |
joined | boolean | false | Joins the boxes into one bar with shared borders. |
rounded | string | md | Corner radius of the boxes. With Joined boxes on, only the outer corners round. |
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.
Yes. A pasted code fills the sequence, with an optional staggered visual entrance.
Yes. An allowed-character setting supports mixed input, and it should match the verification service’s code format.
An invalid state triggers a short shake, which should always come with a readable error message.
It supports autofill-oriented input, though availability depends on the browser, device, input attributes, and delivery method.
It provides the entry interface only. Security depends on the verification service, including expiry, attempt limits, rate limiting, and server-side validation.
Need a custom effect? Tell us what to create.