Skip to content

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.

glass/layout/auth-passkey
Open ↗

Source

"use client";

import { useState } from "react";
import { Fingerprint, KeyRound, Mail, ShieldCheck } from "lucide-react";
import { cn } from "@/lib/utils";

export interface AuthPasskeyProps {
  email?: string;
  /** Called when the user chooses the passkey. Resolve on success, throw on failure. */
  onPasskey?: () => Promise<void> | void;
  onFallback?: (method: "email" | "password") => void;
  className?: string;
}

const GLASS = "da-stroke bg-da-surface backdrop-blur-da backdrop-saturate-150";

/** Passkey sign-in: large animated fingerprint orb in a glass card, “Use passkey” with waiting / success / error states, and email-link or password fallbacks. */
export function AuthPasskey({ email = "amara@lumen.io", onPasskey, onFallback, className }: AuthPasskeyProps) {
  const [state, setState] = useState<"idle" | "waiting" | "ok" | "error">("idle");

  const go = async () => {
    setState("waiting");
    try {
      await onPasskey?.();
      setState("ok");
    } catch {
      setState("error");
    }
  };

  return (
    <div className={cn("grid min-h-dvh place-items-center px-4 py-12 text-da-fg", className)}>
      <main className={cn("w-full max-w-sm rounded-da-lg p-8 text-center shadow-da-lg", GLASS)}>
        <div className="relative mx-auto grid size-28 place-items-center">
          <span
            aria-hidden
            className={cn(
              "absolute inset-0 rounded-full bg-gradient-to-br from-da-primary to-da-accent opacity-30 blur-xl",
              state === "waiting" && "animate-pulse motion-reduce:animate-none",
            )}
          />
          <span
            aria-hidden
            className={cn(
              "relative grid size-24 place-items-center rounded-full text-da-primary-fg shadow-da-lg transition-colors duration-(--da-duration)",
              state === "ok" ? "bg-da-success" : state === "error" ? "bg-da-danger" : "bg-gradient-to-br from-da-primary to-da-accent",
            )}
          >
            {state === "ok" ? <ShieldCheck className="size-11" /> : <Fingerprint className="size-11" />}
          </span>
        </div>
        <h1 className="mt-6 font-da-display text-2xl font-semibold tracking-da-display">Welcome back</h1>
        <p className="mt-1 text-sm text-da-muted-fg">
          Signing in as <span className="font-semibold text-da-fg">{email}</span>
        </p>
        <button
          type="button"
          onClick={go}
          disabled={state === "waiting" || state === "ok"}
          className="da-focus da-transition mt-8 inline-flex h-12 w-full items-center justify-center gap-2 rounded-da-pill bg-gradient-to-r from-da-primary to-da-accent font-semibold text-da-primary-fg shadow-da-md hover:-translate-y-0.5 disabled:opacity-70 disabled:hover:translate-y-0"
        >
          <KeyRound aria-hidden className="size-4" />
          {state === "waiting" ? "Waiting for your device…" : state === "ok" ? "Signed in" : "Sign in with passkey"}
        </button>
        <p role="status" aria-live="polite" className={cn("mt-3 min-h-5 text-sm", state === "error" ? "text-da-danger" : "text-da-muted-fg")}>
          {state === "waiting"
            ? "Use Face ID, Touch ID or your security key."
            : state === "error"
              ? "That didn’t work. Try again or use another method."
              : state === "ok"
                ? "Redirecting to your meetings…"
                : ""}
        </p>
        <div className="mt-6 border-t border-da-border-strong pt-6">
          <p className="text-xs text-da-muted-fg">Other ways to sign in</p>
          <div className="mt-3 grid grid-cols-2 gap-2">
            <button
              type="button"
              onClick={() => onFallback?.("email")}
              className="da-focus da-transition da-stroke inline-flex h-11 items-center justify-center gap-2 rounded-da-pill bg-da-surface text-sm font-semibold hover:bg-da-secondary"
            >
              <Mail aria-hidden className="size-4" /> Email link
            </button>
            <button
              type="button"
              onClick={() => onFallback?.("password")}
              className="da-focus da-transition da-stroke inline-flex h-11 items-center justify-center gap-2 rounded-da-pill bg-da-surface text-sm font-semibold hover:bg-da-secondary"
            >
              <KeyRound aria-hidden className="size-4" /> Password
            </button>
          </div>
        </div>
      </main>
    </div>
  );
}

export default AuthPasskey;

modules/glass/layout/auth-passkey/index.tsx

Props

PropTypeDefaultDescription
emailstring—Account.
onPasskey() => Promise<void> | void—Run WebAuthn; throw on failure.
onFallback(method: "email" | "password") => void—Other methods.
classNamestring—Classes.

Other auth screen variants in Glass

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.

BrutalistAuth screen

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.

BrutalistAuth screen

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.

BrutalistAuth screen

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.

BrutalistAuth screen

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.

MinimalAuth screen

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.

MinimalAuth screen

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.

MinimalAuth screen

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.

MinimalAuth screen

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.

Mono CleanAuth screen

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.

Mono CleanAuth screen

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.

Mono CleanAuth screen

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.

Mono CleanAuth screen

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.

Neo CorporateAuth screen

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).

Neo CorporateAuth screen

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.

Neo CorporateAuth screen

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.

Neo CorporateAuth screen

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.

Organic SoftAuth screen

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.

Organic SoftAuth screen

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.

Organic SoftAuth screen

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).

Organic SoftAuth screen

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.

Soft FlatAuth screen

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.

Soft FlatAuth screen

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.

Soft FlatAuth screen

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.

Soft FlatAuth screen