LoginForm

Email + password form used inside <LoginPage>. Calls authProvider.login() via the useLogin hook and surfaces errors through useNotify. Returns just the form — no surrounding card or layout — so it can be embedded inside any auth shell.

Installation

pnpm dlx shadcn@latest add @shadmin/login-form

Usage

Compose it with <AuthLayout> to build a custom login page:

import { AuthLayout } from "@/components/admin/auth-layout";
import { LoginForm } from "@/components/admin/login-form";
 
export const LoginPage = () => (
  <AuthLayout title="Sign in">
    <LoginForm />
  </AuthLayout>
);

<LoginForm> is also the form rendered by the default <LoginPage> — so customizing the surrounding layout is often as simple as wrapping it differently.

Props

PropRequiredTypeDefaultDescription
redirectToOptionalstring-Path the user is redirected to after a successful sign in. Defaults to ra-core's default redirect (/).
classNameOptionalstring-Extra CSS class names applied to the <Form> element.

redirectTo

Where the user lands after a successful sign in. Forwarded to useLogin.

<LoginForm redirectTo="/dashboard" />

className

Add extra Tailwind class names to the form element.

<LoginForm className="max-w-sm mx-auto" />