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
onFormSubmit(data: LoginFormData) => voidCalled when the form is submitted with email and password
onSocialLogin(provider: string) => voidCalled when social login button is clicked
forgotPasswordHrefstring#URL for forgot password link
signUpHrefstring#URL for sign up link
loadingenumfalseWhether the form is in a loading state
titlestringLogin to your accountCustom title for the card
descriptionstringEnter your email below to login to your accountCustom description for the card
glowenumfalseEnable 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