Recovery Codes

Full-height two-factor backup screen that displays single-use recovery codes in a grid with copy and download actions, a warning callout, and a confirmation checkbox that gates the continue button. Perfect for 2FA setup and account recovery.

PRO

Auth22: Recovery Codes

Full-height two-factor backup screen: a centered key icon and heading over a bordered card that lists single-use recovery codes in a two-column monospace grid, copy and download actions, a destructive warning callout, and a confirmation checkbox that gates the continue button. Built for 2FA setup and account recovery flows.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/auth22?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/auth22?email=YOUR_EMAIL&license_key=YOUR_KEY"

This installs the block to components/beste/block/auth22.tsx and the button, checkbox, and field shadcn/ui primitives it's built on.

Quick start

The installed file exports auth22Demo alongside the block: the exact props behind the preview above. Spread it to get a working recovery-codes screen in one line.

tsx
import { Auth22, auth22Demo } from "@/components/beste/block/auth22";

export default function RecoveryCodesPage() {
  return <Auth22 {...auth22Demo} />;
}

Then replace the demo with your own props. Written out, a trimmed setup looks like this:

tsx
import { KeyRound } from "lucide-react";
import { Auth22 } from "@/components/beste/block/auth22";

export default function RecoveryCodesPage() {
  return (
    <Auth22
      icon={<KeyRound className="size-7" />}
      heading="Save your recovery codes"
      description="Keep these codes somewhere safe."
      codes={["4f9k-2x7p", "8m3q-1v6z", "7c2w-9b4n", "5h8d-3t1r"]}
      downloadFileName="recovery-codes.txt"
      continueButton={{ label: "Continue", href: "/dashboard" }}
      labels={{
        copy: "Copy codes",
        download: "Download",
        warning: "You won't be able to view these codes again.",
        confirm: "I have saved my recovery codes",
      }}
    />
  );
}

Props

PropTypeDefaultDescription
iconReact.ReactNodeIcon rendered in a muted circle above the heading
headingstringScreen title
descriptionstringSubtext below the heading
codesstring[][]Recovery codes shown in a two-column monospace grid
downloadFileNamestring"recovery-codes.txt"File name used for the client-side .txt download
continueButton{ label: string; href: string }Bottom action; hidden entirely when not set
labelsobject{}Button and callout copy, see below
classNamestringExtra classes for the outer <section>
ts
type Auth22Labels = {
  copy?: string;
  copied?: string;
  download?: string;
  warning?: string;
  confirm?: string;
};

Behavior notes

Wiring the form up

This block ships the form markup only; state, validation, and submit are yours to add. Our guide wires the shadcn Field primitives to React Hook Form, TanStack Form, and Formisch on one field system.

More Auth blocks

View all Auth
PRO

auth47

Recovery Phrase Entry

Full-height account recovery screen with a numbered grid of word inputs and paste-to-fill support, plus a restore button that unlocks once every word is entered. Perfect for seed phrase and recovery-phrase restore flows.

FREE

auth4

Forgot Password Request

Full-height password recovery screen with a centered icon, single email field built on the shadcn Field primitives, a send-reset-link button, and a back-to-sign-in link. Perfect for the first step of any password reset flow.

PRO

auth39

Enable Two-Factor

Full-height security setup step where the user picks a two-factor method from selectable cards (authenticator app, SMS, or security key), with a skip option. Perfect for guiding users through enabling 2FA.

PRO

auth12

Email Confirmed Success

Full-height success screen with a large confirmation check, a heading and message, a primary continue button, and a support link. Perfect for the final step after email verification or account activation.

FREE

auth3

Email Verification Code

Full-height OTP verification screen with a centered icon, segmented six-digit code input, a verify button that unlocks once the code is complete, and a live resend countdown timer. Perfect for two-factor auth, magic links, and email confirmation flows.

PRO

auth41

Delete Account

Full-height destructive confirmation screen that lists the consequences and requires the user to type a confirmation word before the delete button enables. Perfect for account deletion and other irreversible actions.