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.
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.
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.
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
npx shadcn add "https://ui.beste.co/r/auth22?email=YOUR_EMAIL&license_key=YOUR_KEY"Base UI flavor
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.
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.
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:
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",
}}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
icon | React.ReactNode | – | Icon rendered in a muted circle above the heading |
heading | string | – | Screen title |
description | string | – | Subtext below the heading |
codes | string[] | [] | Recovery codes shown in a two-column monospace grid |
downloadFileName | string | "recovery-codes.txt" | File name used for the client-side .txt download |
continueButton | { label: string; href: string } | – | Bottom action; hidden entirely when not set |
labels | object | {} | Button and callout copy, see below |
className | string | – | Extra classes for the outer <section> |
type Auth22Labels = {
copy?: string;
copied?: string;
download?: string;
warning?: string;
confirm?: string;
};navigator.clipboard.writeText(codes.join("\n")) call; on success it swaps its icon and label to labels.copied (default "Copied") for 2 seconds via setTimeout, then reverts.Blob from codes.join("\n"), creates an object URL, and clicks a temporary <a download> anchor, all without any server request; the file name comes from downloadFileName.disabled (and rendered as a plain, non-link <Button>) whenever labels.confirm is set and the checkbox is unchecked; once checked, or whenever labels.confirm is omitted entirely, it becomes a real asChild link to continueButton.href.labels.confirm is set; the warning callout (destructive-tinted, with a TriangleAlert icon) only renders when labels.warning is set.labels.copy / labels.download, so either action can be dropped without affecting the other.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.
auth47
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.
auth4
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.
auth39
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.
auth12
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.
auth3
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.
auth41
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.