Auth Screen
Centered passwordless login in three steps: provider choice (Google, email, SAML SSO) → email form → "check your email" confirmation. Faint indigo glow on top, legal footer.
minimal/layout/auth-screenSource
"use client";
import { useId, useState, type FormEvent } from "react";
import { ArrowLeft, Mail } from "lucide-react";
import { cn } from "@/lib/utils";
export interface AuthScreenProps {
brand?: string;
brandHref?: string;
title?: string;
subtitle?: string;
/** Called with the email; resolve to show the "check your inbox" state. */
onEmailSubmit?: (email: string) => void | Promise<void>;
onProvider?: (provider: "google" | "github" | "sso") => void;
error?: string;
legal?: { termsHref: string; privacyHref: string };
className?: string;
}
export function AuthScreen({
brand = "Tracewise",
brandHref = "/",
title = "Log in to Tracewise",
subtitle = "Welcome back. Use your work account to continue.",
onEmailSubmit,
onProvider,
error,
legal = { termsHref: "#terms", privacyHref: "#privacy" },
className,
}: AuthScreenProps) {
const [step, setStep] = useState<"choose" | "email" | "sent">("choose");
const [email, setEmail] = useState("");
const [pending, setPending] = useState(false);
const emailId = useId();
const errorId = useId();
async function submit(e: FormEvent<HTMLFormElement>) {
e.preventDefault();
setPending(true);
try {
await onEmailSubmit?.(email);
setStep("sent");
} finally {
setPending(false);
}
}
const providerBtn =
"da-focus da-transition da-stroke flex h-10 w-full items-center justify-center gap-2.5 rounded-da-md bg-da-surface text-sm font-medium text-da-surface-fg shadow-da-sm hover:bg-da-muted";
return (
<div className={cn("relative isolate flex min-h-full flex-col items-center justify-center bg-da-bg px-4 py-16 text-da-fg", className)}>
<div aria-hidden className="absolute inset-x-0 top-0 -z-10 h-72 [background:radial-gradient(ellipse_50%_60%_at_50%_0%,color-mix(in_oklab,var(--da-primary)_14%,transparent),transparent)]" />
<a href={brandHref} className="da-focus mb-10 grid size-10 place-items-center rounded-da-md bg-da-fg text-da-bg shadow-da-md" aria-label={`${brand} home`}>
<svg aria-hidden viewBox="0 0 24 24" className="size-5" fill="none">
<path d="M3 12h4l2.5-6 5 12 2.5-6H21" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</a>
<div className="w-full max-w-[340px] text-center">
{step === "sent" ? (
<div role="status">
<span className="mx-auto grid size-10 place-items-center rounded-full bg-da-accent text-da-accent-fg">
<Mail aria-hidden className="size-4" />
</span>
<h1 className="mt-5 text-xl font-semibold tracking-tight">Check your email</h1>
<p className="mt-2 text-sm text-da-muted-fg">
We sent a login link to <span className="font-medium text-da-fg">{email}</span>. It expires in 10 minutes.
</p>
<button type="button" onClick={() => setStep("email")} className="da-focus mt-6 rounded-da-sm text-sm text-da-muted-fg hover:text-da-fg">
Use a different email
</button>
</div>
) : (
<>
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
<p className="mt-2 text-sm text-da-muted-fg">{subtitle}</p>
<div className="mt-8 flex flex-col gap-2.5">
{step === "choose" ? (
<>
<button type="button" className={providerBtn} onClick={() => onProvider?.("google")}>
<svg aria-hidden viewBox="0 0 24 24" className="size-4">
<path fill="#4285F4" d="M23.5 12.3c0-.8-.1-1.6-.2-2.3H12v4.5h6.5a5.6 5.6 0 0 1-2.4 3.6v3h3.9c2.2-2.1 3.5-5.1 3.5-8.8Z" />
<path fill="#34A853" d="M12 24c3.2 0 6-1.1 8-2.9l-3.9-3c-1.1.7-2.5 1.2-4.1 1.2-3.1 0-5.8-2.1-6.7-5H1.3v3.1A12 12 0 0 0 12 24Z" />
<path fill="#FBBC05" d="M5.3 14.3a7.2 7.2 0 0 1 0-4.6V6.6H1.3a12 12 0 0 0 0 10.8l4-3.1Z" />
<path fill="#EA4335" d="M12 4.8c1.8 0 3.3.6 4.6 1.8l3.4-3.4A12 12 0 0 0 1.3 6.6l4 3.1c.9-2.9 3.6-4.9 6.7-4.9Z" />
</svg>
Continue with Google
</button>
<button type="button" className={providerBtn} onClick={() => setStep("email")}>
<Mail aria-hidden className="size-4" />
Continue with email
</button>
<button type="button" className={cn(providerBtn, "bg-transparent shadow-none [--da-border:transparent]")} onClick={() => onProvider?.("sso")}>
Continue with SAML SSO
</button>
</>
) : (
<form onSubmit={submit} className="flex flex-col gap-2.5 text-left" aria-describedby={error ? errorId : undefined}>
<label htmlFor={emailId} className="sr-only">
Work email
</label>
<input
id={emailId}
type="email"
required
autoFocus
autoComplete="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Enter your work email…"
aria-invalid={error ? true : undefined}
className="da-focus da-stroke h-10 rounded-da-md bg-da-input px-3 text-sm shadow-da-sm placeholder:text-da-muted-fg"
/>
{error && (
<p id={errorId} role="alert" className="text-[13px] text-da-danger">
{error}
</p>
)}
<button
type="submit"
disabled={pending}
className="da-focus da-transition h-10 rounded-da-md bg-da-primary text-sm font-medium text-da-primary-fg hover:bg-da-primary/90 disabled:opacity-60"
>
{pending ? "Sending link…" : "Continue with email"}
</button>
<button
type="button"
onClick={() => setStep("choose")}
className="da-focus mt-2 inline-flex items-center justify-center gap-1.5 self-center rounded-da-sm text-[13px] text-da-muted-fg hover:text-da-fg"
>
<ArrowLeft aria-hidden className="size-3.5" /> Back to login options
</button>
</form>
)}
</div>
</>
)}
<p className="mt-10 text-xs leading-relaxed text-da-muted-fg">
By continuing you agree to our{" "}
<a href={legal.termsHref} className="da-focus rounded-[2px] underline underline-offset-2 hover:text-da-fg">
Terms
</a>{" "}
and{" "}
<a href={legal.privacyHref} className="da-focus rounded-[2px] underline underline-offset-2 hover:text-da-fg">
Privacy Policy
</a>
.
</p>
</div>
</div>
);
}
export default AuthScreen;
modules/minimal/layout/auth-screen/index.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| brand / brandHref | string | "Tracewise" / "/" | Logo link label and target. |
| title / subtitle | string | — | Heading and supporting line. |
| onEmailSubmit | (email: string) => void | Promise<void> | — | Send the magic link; the "sent" step shows after it resolves. |
| onProvider | (provider: "google" | "github" | "sso") => void | — | OAuth / SSO handler. |
| error | string | — | Error under the email field (role=alert). |
| legal | { termsHref: string; privacyHref: string } | — | Legal links. |
| className | string | — | Classes on the root. |
Other auth screen variants in Minimal
Auth Split
Split sign-in screen: form on the left (email, password with reveal, remember me, error alert) and an always-dark brand panel with indigo glow, grid, customer quote and three stats on large screens.
Auth Sso
SSO-first sign-in card on a tinted page: key icon, Google / GitHub / Microsoft buttons, an ‘or use SAML SSO’ divider and work-email discovery with inline arrow submit, legal links below.
Auth Verify
Email verification screen: mail icon, six single-digit mono boxes (split 3 + 3) with auto-advance, paste, arrow/backspace navigation, auto-submit, error and success states and a resend countdown.
Auth screen in other art directions
Auth Card
Centered login card on a dotted paper background: tilted wordmark sticker, ink title band, GitHub button, email + password with forgot link, error slot and a big pressable yellow submit.
Auth Magic Link
Passwordless login split screen: blue product panel with staggered pipeline cards (desktop), huge uppercase headline, single email field and yellow send button, then a 'Check your inbox' state with open-mail and retry actions.
Auth Screen
Split sign-in / sign-up page: form column with GitHub & Google buttons, email + password (show/hide), remember-me, error slot and pending state; yellow grid panel with a big customer quote on desktop.
Auth Signup Steps
Three-step signup wizard: ruled step tabs (done in ink, current in yellow) fused to a card with account fields, team size and use-case tile choices, Back/Continue and a success state.
Auth Floating
Sign-up screen: centered glass card (Google button, divider, email magic-link form with success state) surrounded on desktop by floating, bobbing glass preview cards and a gradient orb.
Auth Onboarding
Three-step onboarding glass card: workspace name with URL preview, role radio chips, calendar connection buttons; gradient progress bar, back/continue and a finish screen.
Auth Passkey
Passkey sign-in glass card: glowing gradient fingerprint orb, account email, ‘Sign in with passkey’ with waiting / success / error states and email-link or password fallbacks.
Auth Screen
Centered 40px-blur glass panel over the mesh and two soft orbs: gradient logo, Google/Microsoft buttons, email + password (show/hide), forgot link, error slot, gradient pill submit. Sign-in and sign-up modes.
Auth Centered
Minimal centered sign-in with lots of air: logo, small title, two hairline-boxed fields stacked edge to edge, ink button, “or continue with” text links and a mono legal line at the very bottom.
Auth Magic
Passwordless: a huge “Enter your email” prompt with a single oversized underline input and ↵ button; after submit, a large confirmation with the address and a mono resend link.
Auth Screen
Split sign-in: the left half is an ink panel with a large statement and mono footer; the right half holds a minimal underline form (email, password), an ink button and text links. Panel hides on mobile.
Auth Steps
Three-step sign-up with an index header “01 / 03 — Your account” and segmented hairline progress; underline fields per step, Back text link and ink Continue; final step shows the site address preview.
Auth Screen
Centered sign-in card on a surface-2 page: logo, Google + SSO buttons, “or” divider, email/password (show/hide toggle, forgot link), remember me, blue submit, sign-up link and legal footer.
Auth Split
Split sign-up page: form on the left (name, work email, company, password with live strength checklist), blue gradient panel on the right with benefits, a customer quote and compliance badges (panel hidden below lg).
Auth Sso
Enterprise SSO sign-in: email-first step that detects the domain; SSO domains show the org + identity provider and a “Continue with Okta” button, others fall back to a password field.
Auth Verify
Two-factor verification screen: shield icon, 6 separate digit boxes (auto-advance, backspace, paste support), error/success states, resend with 30s countdown and “use a recovery code” link.
Auth Magic
Passwordless sign-in: one rounded email field and “Send me a link”, then a gentle sent state with an open-envelope in a sage circle, the address, resend and change-email links.
Auth Onboarding
Post-signup onboarding: two gentle steps (industry as pill radio cards, goals as check cards) with a leaf progress bar, back/continue pills and a warm “all set” finish.
Auth Screen
Centered sign-in on cream with two soft blobs behind a rounded card: serif welcome, filled inputs, password reveal, sage pill submit, Google alternative and a sign-up link.
Auth Split
Split sign-up: form on cream (name, email, company, team-size pills) and an arch-topped landscape illustration panel with sun and hills plus a quote card (hidden below lg).
Auth Magic
“Check your inbox” screen: flat envelope with a gently bobbing letter, email in bold, Gmail/Outlook shortcut pills, resend with countdown and change-email link.
Auth Screen
Centered friendly sign-in: big rounded white card among pastel shapes, shape logo, Google button, rounded divider, soft email/password fields with reveal, error alert and periwinkle pill.
Auth Split
Sign-up split: lavender panel with a flat illustration of tilted task cards and perk list on large screens, roomy name + email form with a success message on the other side.
Auth Welcome
First-run profile setup: big live avatar preview, grid of pastel emoji avatars (native radios), display-name field with preview chip and a “Let’s go” button enabled once named.