C
Cassa UI

@cassa/auth-ui

Ready-to-drop authentication forms. The UI is opinionated; the auth logic is yours. Works with next-auth, Clerk, custom JWTs, or any backend — just wire up onSubmit.

Import

import { LoginForm, SignupForm, ForgotPasswordForm, AuthGuard } from '@cassa/auth-ui'

LoginForm

Welcome back

Sign in to your account

Custom title

Sign in to Acme

Use your company email to continue.

AuthGuard

Wraps protected content and renders a fallback when the user is not authenticated:

import { AuthGuard } from '@cassa/auth-ui'

<AuthGuard
  isAuthenticated={!!session}
  fallback={<LoginForm onSubmit={handleLogin} />}
>
  <Dashboard />
</AuthGuard>

LoginForm props

PropTypeDefaultDescription
onSubmit*(values: { email: string; password: string }) => void | Promise<void>Called with validated values. You own the auth logic.
titlestring"Welcome back"Replaces the default card title.
descriptionstring"Sign in to your account"Replaces the card subtitle.
footerReact.ReactNodeRendered below the form — use for "Forgot password" or "Sign up" links.

AuthGuard props

PropTypeDefaultDescription
isAuthenticated*booleanIf false, renders fallback instead of children.
fallbackReact.ReactNodeWhat to render when unauthenticated. Defaults to null.
isLoadingbooleanShows a loading state while auth status is being determined.
children*React.ReactNodeProtected content.