Security Question Setup

Set a security question

We'll use this to verify your identity if you ever get locked out.

Set this up later? Skip for now

About this block

Security Question SetupPRO

Full-height security question setup with a question select and an answer field, plus a skip option. Perfect for account recovery setup and identity verification fallbacks.

Auth48: Security Question Setup

A full-height centered card that lets a user set a security question for account recovery: an optional circular icon, heading, and description sit above a bordered card holding a Select of security questions, a free-text answer Input, and a submit Button, with an optional skip prompt link below.

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.

Upgrade Now

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/auth48?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

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

This installs the block to components/beste/block/auth48.tsx, plus the button, input, select, and field shadcn/ui primitives it uses for the submit action, the answer entry, the question dropdown, and the labeled field layout.

Quick start

The installed file exports auth48Demo alongside the block: the exact props behind the preview above. Spread it to get a working security question form in one line.

tsx
import { Auth48, auth48Demo } from "@/components/beste/block/auth48";

export default function SecurityQuestionPage() {
  return <Auth48 {...auth48Demo} />;
}

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

tsx
import { ShieldQuestion } from "lucide-react";
import { Auth48 } from "@/components/beste/block/auth48";

export default function SecurityQuestionPage() {
  return (
    <Auth48
      icon={<ShieldQuestion className="size-6" />}
      heading="Set a security question"
      description="We'll use this to verify your identity if you ever get locked out."
      questions={[
        { value: "pet", label: "What was the name of your first pet?" },
        { value: "city", label: "In what city were you born?" },
      ]}
      defaultQuestion="pet"
      labels={{
        question: "Security question",
        answer: "Your answer",
        submit: "Save security question",
      }}
      skipPrompt={{ text: "Set this up later?", linkLabel: "Skip for now", href: "/dashboard" }}
    />
  );
}

Props

PropTypeDefaultDescription
iconReact.ReactNodeOptional glyph shown in the circular badge above the heading
headingstringCentered page heading, rendered as an <h1>
descriptionstringMuted supporting line under the heading
questionsSecurityQuestion[][]Options rendered inside the question Select
defaultQuestionstringInitial selected question value, seeds internal state
labels{ question?: string; questionPlaceholder?: string; answer?: string; answerPlaceholder?: string; submit?: string }{}Field labels, placeholders, and submit button text
skipPrompt{ text: string; linkLabel: string; href: string }Optional skip line and link rendered below the card
classNamestringExtra classes for the outer <section>
ts
type SecurityQuestion = {
  value: string;
  label: string;
};

Behavior notes

  • The selected question is held in a local useState seeded from defaultQuestion; there is no onChange/onValueChange callback exposed, so the current selection is never lifted out of the component.
  • The answer Input is fully uncontrolled: its value is never read into state or forwarded anywhere, so whatever the user types is discarded on submit.
  • The <form> onSubmit only calls e.preventDefault(); there is no submit handler prop, so wiring the actual save request is left entirely to the integrator.
  • Each of icon, heading, description, and every labels sub-field (question label, answer label, submit) is conditionally rendered, so omitting one drops it from the layout rather than showing an empty slot.
  • The submit Button is only rendered when labels.submit is set, and it is always enabled (no dirty/valid gating).
  • Labels and inputs are associated via a useId-derived fieldId, so accessibility linking works even with multiple instances on a page.
  • skipPrompt renders through a next/link Link, and the whole prompt paragraph is omitted when the prop is absent.

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.

PRO

auth24

Complete Your Profile

Full-height profile setup step with an avatar uploader, a display name field, and a bio textarea, plus a skip option. Perfect for the post-sign-up onboarding step where users personalize their account.

PRO

auth46

Confirm It's You

Full-height step-up authentication screen that re-asks for the password before a sensitive action, showing the signed-in account and a cancel option. Perfect for protecting billing, security, and destructive actions.

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.

FREE

auth5

Set New Password

Full-height reset-password screen with new and confirm password fields (each with a show/hide toggle) and a live requirements checklist that ticks off rules as the user types. Perfect for the final step of a password reset or invite flow.

PRO

auth43

Join the Waitlist

Full-height waitlist capture with an email field, a join button, a social-proof line, and a sign-in link for existing users. Perfect for pre-launch and early-access landing gates.