@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
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit* | (values: { email: string; password: string }) => void | Promise<void> | — | Called with validated values. You own the auth logic. |
| title | string | "Welcome back" | Replaces the default card title. |
| description | string | "Sign in to your account" | Replaces the card subtitle. |
| footer | React.ReactNode | — | Rendered below the form — use for "Forgot password" or "Sign up" links. |
AuthGuard props
| Prop | Type | Default | Description |
|---|---|---|---|
| isAuthenticated* | boolean | — | If false, renders fallback instead of children. |
| fallback | React.ReactNode | — | What to render when unauthenticated. Defaults to null. |
| isLoading | boolean | — | Shows a loading state while auth status is being determined. |
| children* | React.ReactNode | — | Protected content. |