Email Verification Code
A full-height email verification screen: a segmented 6-digit code input that auto-advances focus as you type and moves back on backspace, a Verify button disabled until all 6 digits are filled, and a live countdown that swaps into a Resend code button once it reaches zero.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/email-verification-code.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/auth/auth3.tsx instead.
Usage
The file also exports auth3Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Auth3, auth3Demo } from "@/components/blocks/auth/auth3"; export default function Page() { return <Auth3 {...auth3Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Check your email" | Screen heading. |
| description | string | "We sent a 6-digit verification code to your email address. Enter it below to continue." | Short description shown under the heading. |
| string | none | Email address the code was supposedly sent to, appended to the description when set. | |
| resendSeconds | number | 30 | Seconds the resend countdown starts from. |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- The 6 code inputs are real client-side state: typing a digit auto-advances focus to the next box, and backspace on an empty box moves focus back to the previous one.
- The Verify button's disabled state is derived from real state too, it only becomes clickable once all 6 boxes are filled, though clicking it does not verify anything against a real backend.
- The countdown is a genuine setInterval-driven timer (cleaned up on unmount) starting from resendSeconds; once it reaches 0 the text is replaced with a Resend code button that restarts the same local timer, no email is actually sent or resent.
More Auth Blocks
View all →centered-sign-in-card
Centered Sign In Card
Full-height centered sign-in card with social buttons, a password show/hide toggle, and remember-me.
split-screen-sign-up
Split-Screen Sign Up
Two-column registration screen with a sign-up form on one side and a full-bleed photo with a customer quote on the other.
forgot-password-request
Forgot Password Request
Full-height password recovery screen with a single email field, a send-reset-link button, and a back-to-sign-in link.
set-new-password
Set New Password
Full-height reset-password screen with independent show/hide toggles per field and a live password-requirements checklist.
magic-link-sign-in
Magic Link Sign In
Full-height passwordless sign-in screen with an email field, a send-magic-link button, and social login as a fallback.
account-chooser
Account Chooser
Full-height account picker listing saved accounts with avatars, plus a Use another account row.