Sign-in or sign-up screen: social buttons, email and password, submit.
Default
The sign-in card with social buttons, email and password.
Log in to your account
Welcome back! Please enter your details.
Don't have an account? Sign up
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add auth-cardBrings the 8 files it builds on (button.tsx, glyph.tsx, checkbox.tsx, field.tsx, icon.tsx, select-menu.tsx, floating.tsx, social-button.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/auth-card.tsx.
import { AuthCard } from "@/design-system/components/auth-card";Usage
<AuthCard mode="sign-in" onSubmit={signIn} switchHref="/sign-up" />Examples
Sign up
The sign-up mode asks for a new password and changes the copy.
Create an account
Set up your studio workspace in a minute.
Already have an account? Log in
Email only
Pass an empty providers list to hide the social buttons and divider.
Welcome to the Denzing portal
Log in to review your brand refresh.
Don't have an account? Sign up
Pending and errors
pending disables the form; errors shows messages from the server.
When to use
Use it when
- The login and sign-up pages
Don’t use it when
- Any other form → Field and inputs + Button in a Dialog or page
Rules
- The page handles real authentication in onSubmit; it is only called once the built-in checks pass (required, email format, 8+ characters on sign-up)
- Pass server errors through errors; they replace the built-in messages
Properties
AuthCard
| Prop | Type | Default |
|---|---|---|
mode * | "sign-in" | "sign-up" | – |
logo | ReactNode | – |
title | string | – |
subtitle | ReactNode | – |
providers | SocialProvider[] | ["google", "apple", "figma"] |
onProvider | (provider: SocialProvider) => void | – |
onSubmit | (values: AuthValues) => void | – |
pending | boolean | false |
errors | { email?: string; password?: string } | – |
forgotPasswordHref | string | "#" |
switchHref | string | "#" |
className | string | – |
* required
Accessibility
- Errors are tied to their fields