Login form
Auth4 pieces3 statesEmail and password login with 'Remember me', 'Forgot password?' and an optional sign-up link. Validates on blur and submit; a server error shows in a Banner above the fields.
In every theme
Same block, same props. Only the tokens change.
Pulse
HealthRelay
SaaSStates
default · error · loading
default
error
loading
Sector rules · 8
Returned as sectorRules. Your agent applies the ones for your industry.
Health
3 rules- 01
After the password, ask for a verification code (VerificationCode block) before showing any health data.
- 02
Log out after 15 minutes without activity and say so on this screen: 'You were logged out to protect your data.'
- 03
Link the privacy notice under the form; patients must be able to read it before logging in.
Fintech
3 rules- 01
Offer Face ID / fingerprint as the first option on mobile once the device is trusted; the password form is the fallback.
- 02
On a new device, ask for a verification code and send a 'New sign-in' alert to the user.
- 03
Never say whether the email exists; use one error for both fields.
SaaS
2 rules- 01
Add 'Continue with SSO' for work accounts as a separate block above the form.
- 02
Keep 'Remember me' on by default; sessions last until the user logs out.
Built from the library
Every piece links to its own spec.
| Prop | Type | Description |
|---|---|---|
| onSubmit | (values: { email: string; password: string; remember: boolean }) => void | Called only when both fields are valid. |
| error | string | Server error, e.g. 'Wrong email or password'; shows the destructive Banner. |
| loading | boolean | Button shows the spinner and 'Logging in'. |
| defaultValues | { email?: string; password?: string; remember?: boolean } | Starting values, e.g. a remembered email; remember defaults to true. |
| title / description | string | Heading and intro line. |
| onForgotPassword / onSignUp | () => void | Secondary links; the sign-up line only renders with onSignUp. |
npx shadcn add https://unbuiltui.com/r/login-form.json