Skip to content

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.

glass/layout/auth-screen
Open ↗

Source

"use client";

import { useId, useState, type FormEvent } from "react";
import { Eye, EyeOff } from "lucide-react";
import { cn } from "@/lib/utils";

export interface AuthScreenValues {
  email: string;
  password: string;
}

export interface AuthScreenProps {
  mode?: "sign-in" | "sign-up";
  brand?: string;
  brandHref?: string;
  onSubmit?: (values: AuthScreenValues) => void | Promise<void>;
  onProvider?: (provider: "google" | "microsoft") => void;
  error?: string;
  forgotHref?: string;
  switchHref?: string;
  className?: string;
}

const GLASS = "da-stroke bg-da-surface backdrop-blur-[40px] backdrop-saturate-150 shadow-da-lg";
const FIELD =
  "da-transition h-11 w-full rounded-da-md border border-da-border-strong/60 bg-da-input px-3.5 text-sm outline-none placeholder:text-da-muted-fg focus:border-da-primary/60 focus:ring-4 focus:ring-da-primary/15";

export function AuthScreen({
  mode = "sign-in",
  brand = "Halo",
  brandHref = "/",
  onSubmit,
  onProvider,
  error,
  forgotHref = "#forgot",
  switchHref = mode === "sign-in" ? "#sign-up" : "#sign-in",
  className,
}: AuthScreenProps) {
  const [show, setShow] = useState(false);
  const [pending, setPending] = useState(false);
  const emailId = useId();
  const passwordId = useId();
  const errorId = useId();

  async function submit(e: FormEvent<HTMLFormElement>) {
    e.preventDefault();
    const data = new FormData(e.currentTarget);
    setPending(true);
    try {
      await onSubmit?.({ email: String(data.get("email") ?? ""), password: String(data.get("password") ?? "") });
    } finally {
      setPending(false);
    }
  }

  return (
    <div className={cn("relative isolate flex min-h-full items-center justify-center overflow-hidden px-4 py-16 text-da-fg", className)}>
      {/* Two soft orbs behind the panel for extra depth */}
      <div aria-hidden className="absolute top-1/4 left-1/2 -z-10 size-72 -translate-x-[120%] rounded-full bg-da-primary/40 blur-[80px]" />
      <div aria-hidden className="absolute bottom-1/4 left-1/2 -z-10 size-72 translate-x-[20%] rounded-full bg-da-accent/35 blur-[80px]" />

      <div className={cn("w-full max-w-[400px] rounded-da-lg p-8 sm:p-10", GLASS)}>
        <a href={brandHref} aria-label={`${brand} home`} className="da-focus mx-auto grid size-12 place-items-center rounded-full bg-gradient-to-br from-da-primary to-da-accent shadow-da-md">
          <span className="size-5 rounded-full bg-da-bg/90" />
        </a>
        <h1 className="mt-6 text-center font-da-display text-2xl font-semibold tracking-da-display">
          {mode === "sign-in" ? `Welcome back to ${brand}` : `Create your ${brand} account`}
        </h1>
        <p className="mt-2 text-center text-sm text-da-muted-fg">
          {mode === "sign-in" ? "Your recaps are waiting." : "Free forever for individuals. No credit card."}
        </p>

        <div className="mt-8 grid grid-cols-2 gap-3">
          {(["google", "microsoft"] as const).map((p) => (
            <button
              key={p}
              type="button"
              onClick={() => onProvider?.(p)}
              className="da-focus da-transition da-stroke flex h-11 items-center justify-center gap-2 rounded-da-md bg-da-secondary text-sm font-semibold text-da-secondary-fg hover:-translate-y-0.5"
            >
              {p === "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>
              ) : (
                <svg aria-hidden viewBox="0 0 24 24" className="size-4">
                  <path fill="#F25022" d="M1 1h10v10H1z" />
                  <path fill="#7FBA00" d="M13 1h10v10H13z" />
                  <path fill="#00A4EF" d="M1 13h10v10H1z" />
                  <path fill="#FFB900" d="M13 13h10v10H13z" />
                </svg>
              )}
              {p === "google" ? "Google" : "Microsoft"}
            </button>
          ))}
        </div>

        <p className="my-6 flex items-center gap-3 text-xs text-da-muted-fg" aria-hidden>
          <span className="h-px flex-1 bg-da-border-strong/60" /> or with email <span className="h-px flex-1 bg-da-border-strong/60" />
        </p>

        <form onSubmit={submit} className="grid gap-4" aria-describedby={error ? errorId : undefined}>
          <div className="grid gap-1.5">
            <label htmlFor={emailId} className="text-sm font-semibold">
              Work email
            </label>
            <input id={emailId} name="email" type="email" required autoComplete="email" placeholder="you@company.com" className={FIELD} />
          </div>
          <div className="grid gap-1.5">
            <div className="flex items-center justify-between">
              <label htmlFor={passwordId} className="text-sm font-semibold">
                Password
              </label>
              {mode === "sign-in" && (
                <a href={forgotHref} className="da-focus rounded-da-sm text-xs font-semibold text-da-primary hover:underline">
                  Forgot password?
                </a>
              )}
            </div>
            <div className="relative">
              <input
                id={passwordId}
                name="password"
                type={show ? "text" : "password"}
                required
                minLength={8}
                autoComplete={mode === "sign-in" ? "current-password" : "new-password"}
                className={cn(FIELD, "pr-11")}
              />
              <button
                type="button"
                onClick={() => setShow((s) => !s)}
                aria-label={show ? "Hide password" : "Show password"}
                aria-pressed={show}
                className="da-focus absolute inset-y-0 right-0 grid w-11 place-items-center rounded-r-da-md text-da-muted-fg hover:text-da-fg"
              >
                {show ? <EyeOff aria-hidden className="size-4" /> : <Eye aria-hidden className="size-4" />}
              </button>
            </div>
          </div>
          {error && (
            <p id={errorId} role="alert" className="rounded-da-md bg-da-danger/12 px-3 py-2 text-sm font-medium text-da-fg ring-1 ring-da-danger/30 ring-inset">
              {error}
            </p>
          )}
          <button
            type="submit"
            disabled={pending}
            className="da-focus mt-2 h-11 rounded-da-pill bg-gradient-to-r from-da-primary to-da-accent text-sm font-semibold text-da-primary-fg shadow-da-md transition-[translate,opacity] duration-(--da-duration) ease-da-emphasized hover:-translate-y-0.5 disabled:opacity-60 motion-reduce:transition-none"
          >
            {pending ? "Signing in…" : mode === "sign-in" ? "Sign in" : "Create account"}
          </button>
        </form>

        <p className="mt-6 text-center text-sm text-da-muted-fg">
          {mode === "sign-in" ? "New here? " : "Already have an account? "}
          <a href={switchHref} className="da-focus rounded-da-sm font-semibold text-da-fg hover:underline">
            {mode === "sign-in" ? "Create an account" : "Sign in"}
          </a>
        </p>
      </div>
    </div>
  );
}

export default AuthScreen;

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

Props

PropTypeDefaultDescription
mode"sign-in" | "sign-up""sign-in"Switches copy and autocomplete tokens.
brand / brandHrefstring"Halo" / "/"Brand name and logo link.
onSubmit(values: AuthScreenValues) => void | Promise<void>—Receives { email, password }; awaited for the pending state.
onProvider(provider: "google" | "microsoft") => void—OAuth handler.
errorstring—Error shown with role=alert.
forgotHref / switchHrefstring—Password reset and mode switch links.
classNamestring—Classes on the root.

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