Back to blocks
BlockAuthenticationFree

OTP / Verification Code Block React component

A complete two-step verification screen: text, authenticator or email codes, six boxes with auto-advance, paste and auto-submit, a shake and attempts left on a wrong code, a timed lockout, a resend cooldown, an authenticator refresh ring, recovery codes, trust this device, and a success state.

About the OTP / Verification Code Block component

OTP / Verification Code Block is the screen people see after their password when two-step verification is on. It asks for a six-digit code from a text message, an authenticator app or email, and handles everything around it.

The code boxes move on by themselves, accept a pasted code and check it as soon as the last digit is in. Wrong codes shake and show how many tries are left, too many tries lock the form for a moment, and resending is limited by a countdown. Recovery codes and a trust-this-device option are built in.

When to use it

Use it for sign-in verification, confirming a phone number, approving a sensitive action like a payout, or any step that needs a one-time code.

For a single code field inside a larger form, use the OTP input element instead.

Installation

Add the OTP / Verification Code Block component to your project with the shadcn CLI. It lands in components/otp-verification-block.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/otp-verification-block

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

Password Strength Meter
Free
Reset Password Card
Free
Verify Email Card
Free
Lead Profile Panel
Free
Deals Pipeline Board
Free
Campaign Performance Overview
Free