Login Form
BlockBasic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { LoginForm } from "@corew500/ui/blocks/login-form"
<LoginForm>Content</LoginForm>API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onFormSubmit | (data: LoginFormData) => void | — | Called when the form is submitted with email and password |
| onSocialLogin | (provider: string) => void | — | Called when social login button is clicked |
| forgotPasswordHref | string | # | URL for forgot password link |
| signUpHref | string | # | URL for sign up link |
| loading | enum | false | Whether the form is in a loading state |
| title | string | Login to your account | Custom title for the card |
| description | string | Enter your email below to login to your account | Custom description for the card |
| glow | enum | false | Enable glow effects on inputs and buttons |
| labels | { email?: string; password?: string; rememberMe?: string; } | {} | — |
| placeholders | { email?: string; password?: string; } | {} | — |
| buttonLabels | { submit?: string; loading?: string; forgotPassword?: string; signUp?: string; signUpPrompt?: string; socialGoogle?: string; } | {} | — |
| errors | { email?: string; password?: string; general?: string; } | {} | — |
| features | { rememberMe?: boolean; passwordToggle?: boolean; socialLogin?: boolean; } | {} | — |
Accessibility
Keyboard Navigation
- Password visibility toggle is keyboard accessible
- All interactive elements are keyboard navigable (Tab/Shift+Tab)
- Enter key submits the form when focused on any input
Screen Readers
- Error messages are linked via aria-describedby and aria-invalid
- Form validation errors are announced to screen readers with role="alert"
- Submit button shows loading state with aria-busy attribute
- Remember me checkbox has proper aria-label
Additional
- - All form fields have proper label associations via htmlFor/id
Localization
Translatable Content
- - Component accepts pre-resolved translated strings
- All user-facing text is customizable via props:
- `title`, `description` - Form header text
- `labels` - Field labels (email, password, rememberMe)
- `buttonLabels` - All button/link text (submit, loading, forgotPassword, signUp, socialGoogle)
- No internal text hardcoding - all strings flow through props with English defaults
Additional
- `placeholders` - Input placeholders
- `errors` - Validation error messages