Skip to content
esc

Verification code

Auth3 pieces3 states

Enter a one-time code sent by SMS, email or an authenticator app: one box per digit, paste fills them all, the last digit submits, and 'Resend' waits for a countdown. For MFA at login, confirming an email at sign-up, or approving a payment.

View code

In every theme

Same block, same props. Only the tokens change.

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

Ledger

Fintech

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

Pulse

Health

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

Relay

SaaS

States

default · error · loading

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

default

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

error

Enter the code

We sent a 6-digit code to maria@northclinic.com.

Verification code

Didn't get it? Resend in 30s

loading

Sector rules · 5

Returned as sectorRules. Your agent applies the ones for your industry.

Health

2 rules
  1. 01

    Require it at every login on a device not used in the last 30 days, and before showing results or prescriptions.

  2. 02

    Offer backup codes under 'Use another method'; a lost phone must not lock someone out of their care.

Fintech

3 rules
  1. 01

    Ask for it again before sending money to a new recipient or changing the phone number.

  2. 02

    Prefer an authenticator app or push approval over SMS; keep SMS as a fallback.

  3. 03

    Lock verification for 15 minutes after 5 wrong codes and say how long to wait.

Built from the library

Every piece links to its own spec.

PropTypeDescription
onComplete(code: string) => voidCalled when every box is filled (typed or pasted) and on submit.
destinationstringWhere the code went, masked: '+34 •••• •• 42' or 'j•••@mail.com'.
lengthnumberNumber of digits.
errorstringServer error, e.g. 'That code is wrong or expired'; clears the boxes.
loadingbooleanLocks the boxes; the button shows the spinner and 'Verifying'.
onResend / resendSeconds() => void / numberResend link, enabled after the countdown; it restarts on every resend.
onUseAnotherMethod() => voidGhost button to switch to email, an authenticator app or a backup code.
$npx shadcn add https://unbuiltui.com/r/verification-code.json