Components › Blocks

Auth card

Sign in, sign up and a one-time code step in one card. Uncontrolled, it hands you FormData.

Installation

npx plankui@latest add auth-card

Usage

import { AuthCard } from "@/components/ui/auth-card";

<AuthCard providers={[{ id: "sso", name: "SSO", icon: <Building2 /> }]} onSubmit={(data) => signIn(data)} />

API reference

PropTypeDefaultDescription
mode / onModeChange"sign-in" | "sign-up" | "verify""sign-in"Which screen shows.
providers{ id; name; icon }[][]Other ways in, under the form.
providerLayout"stacked" | "inline""stacked"Full-width buttons or a row of icons.
onSubmit(data: FormData, mode) => void | PromiseRuns on submit, then the card moves to verify.
onVerify(code: string) => void | PromiseRuns when the code is complete.

View the source on GitHub