GitHub

Login Form

Block
User login form with email and password

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { LoginForm } from "@corew500/ui/blocks/login-form"

<LoginForm>Content</LoginForm>

API Reference

Props

PropTypeDefaultDescription
action*SignInActionServer action for signing in. Import from '@corew500/feature-auth/server' and pass as prop. @example ```tsx import { LoginForm } from '@corew500/feature-auth' import { signIn } from '@corew500/feature-auth/server' export default function Page() { return <LoginForm action={signIn} signUpHref="/signup" /> } ```
validationAuthValidationOptionsValidation configuration
localestringLocale for i18n-aware redirects
redirectToenum"/dashboard"Custom redirect path after login, or false to disable auto-redirect. When false, you must handle navigation in onSuccess callback.
onSuccess(data: LoginSuccessData) => void | Promise<void>Called after successful login. Can be async - the form will await completion before redirecting.
onAuthError(error: AuthFormError) => voidCalled when login fails. Receives the error code (if available) and message.
onSubmitStart() => voidCalled immediately before the form submits. Useful for analytics, global loading states, or last-minute checks.