Skip to content

Auth Card

The centered card for sign in, sign up, forgot password and verify code screens: a logo, a title, your form, other ways to sign in and links underneath.

Blockv0.1.0experimentalWCAG 2.2 AAView spec

A ready-made piece, built from the library's own parts.

A block puts several components together into something you would otherwise assemble by hand. It never fetches data: you give it the data, or answer its callbacks. It is copied into your project like any component, with the parts it uses, so you can change anything.

Sign in

Full screen (opens in a new tab)
rdloom

Sign in to your account

Welcome back. Enter your details to continue.
 

Sign up

Full screen (opens in a new tab)
rdloom

Create your account

Free for 14 days. No card needed.
At least 8 characters.
 

Already have an account? Sign in

Forgot password

Full screen (opens in a new tab)
rdloom

Reset your password

Enter your email and we will send you a link to choose a new password.
 

Verify code

Full screen (opens in a new tab)
rdloom

Enter your code

We sent a 6 digit code to your phone. It works for 10 minutes.
 

Split with image

Full screen (opens in a new tab)
rdloom

Join your team

Use the email your invitation was sent to.
At least 8 characters.
 

Muted background

Full screen (opens in a new tab)
rdloom

Welcome back

Sign in to see what changed while you were away.
 

No account yet? Create one

Centered minimal

Full screen (opens in a new tab)
rdloom

Sign in

 

With social buttons

Full screen (opens in a new tab)
rdloom

Create your account

Pick the way you want to sign up.
 

Already have an account? Sign in

Reset password

Full screen (opens in a new tab)
rdloom

Choose a new password

Use something you have not used on another site.

Use 8 or more characters with a mix of letters, numbers and symbols.

 

Installation

npx rdloom add auth-card

Copies the source into src/components/rdloom. Edit it freely: rdloom upgrade merges later versions into your changes.

Use another registry client
npx shadcn@latest add https://rdloom.vimalbhatt.com/r/auth-card.json

Works, but without upgrade tracking.

Usage

import { AuthCard, Button, ErrorSummary, Form, FormSubmitButton, FormTextField } from "@rdloom/react";

<div className="h-full w-full">
  <AuthCard
    brand={<span className="text-lg font-semibold tracking-tight text-[var(--rd-color-text-default)]">rdloom</span>}
    title="Sign in to your account"
    description="Welcome back. Enter your details to continue."
    socialProviders={
      <Button variant="secondary" className="w-full">
        Continue with single sign-on
      </Button>
    }
    footer={
      <>
        <a href="/forgot-password" className={link}>
          Forgot your password?
        </a>
        <p>
          New here?{" "}
          <a href="/sign-up" className={link}>
            Create an account
          </a>
        </p>
      </>
    }
  >
    <Form
      className="flex flex-col gap-4"
      defaultValues={{ email: "", password: "" }}
      onSubmit={async (values) => {
        await new Promise((resolve) => setTimeout(resolve, 600));
        return values.password === "wrong" ? { formError: "The email or password is not right. Check them and try again." } : undefined;
      }}
    >
      <ErrorSummary title="We could not sign you in" />
      <FormTextField
        name="email"
        label="Email"
        type="email"
        autoComplete="email"
        placeholder="you@company.com"
        isRequired
        validate={(v) => (v && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? "Enter an email address like name@company.com." : null)}
      />
      <FormTextField name="password" label="Password" type="password" autoComplete="current-password" isRequired />
      <FormSubmitButton className="w-full">Sign in</FormSubmitButton>
    </Form>
  </AuthCard>
</div>

API Reference

Defined by the spec. Components also accept the props of the React Aria component they wrap.

PropTypeDefault
titlerequired

The screen's title, shown as an h1, e.g. "Sign in to your account".

nodenone
headingLevel

Heading level of the title, 1 to 6.

number1
description

One sentence under the title.

nodenone
brand

Your logo or name, shown above the title.

nodenone
children

The form: Form, fields and a submit button.

nodenone
socialProviders

Buttons for signing in another way. They are set under an "or continue with" line.

nodenone
socialLabel

The text of the line above the social providers.

string"or continue with"
footer

Links under the card content, such as "Forgot your password?" or "Create an account".

nodenone
illustration

An image or panel for the side of the card. Shown from large screens up; hidden on a phone.

nodenone
size

Width of the form column: 22rem, 26rem or 32rem.

"sm" | "md" | "lg""md"
classNames

Extra class names for single parts, so you can restyle one part without editing the file. Keys: root, card, brand, header, title, description, body, socialProviders, footer, illustration.

Partial<Record<"root" | "card" | "brand" | "header" | "title" | "description" | "body" | "socialProviders" | "footer" | "illustration", string>>none

Accessibility

Role none, WCAG 2.2 AA. Tested with axe and keyboard tests; screen reader checks are in the audit checklist.

Keyboard

  • Tab: moves through the form fields, the submit button, the providers, then the footer links

Screen readers announce

  • "Sign in to your account, heading level 1"
  • "or continue with, separator"

What your code must do

  • The title is the page's h1
  • The "or continue with" line is a separator with a text label, read once
  • The illustration is decorative and hidden from screen readers
  • The card holds the form only; error summary, labels and messages come from the Form components you put inside

Block contract

Data
Text for the title and description, and the form as children.
Data states
ready
Permissions
None yet
Events
None
You can replace
classNames for each part; brand, footer, socialProviders and illustration slots; the form you pass as children

Guidelines

Use it when

  • Sign in, sign up, forgot password, reset password, verify code

Avoid it when

  • A settings form inside the app: use a normal page

Don't

  • Putting the account's real credentials in examples or tests
  • Hiding the error summary: a failed submit must be explained

Design tokens

The semantic tokens this component uses. Change them once and every component follows; see Design tokens.

  • --rd-color-surface-default
  • --rd-color-surface-subtle
  • --rd-color-border-default
  • --rd-color-text-default
  • --rd-color-text-muted
  • --rd-radius-overlay