Reset password
Two fields with a cross-field match rule and a strength meter.
Live preview
Source
This exact file renders the preview above.
components/blocks/forms/reset-password.tsx
lib/validation.ts
Demo source — adapt to your project. Foundry is not published as a package.
Usage
Demonstrates a validator that reads the whole values object. A rule that can only see its own field cannot express “these must match”, which is why every validator in Foundry receives all values.
- Re-validation of the confirmation happens as the first field changes, so the error clears itself.
- The form states that other sessions will end — a consequence people should not discover afterwards.
Variants and states
Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.
- Idle
- Mismatch
- Weak password
- Success
Accessibility
- Cross-field errors
- The mismatch is reported on the confirmation field, where the user can act on it.
- Autocomplete
- Both fields use `new-password` so managers offer to update the stored entry.
Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.
Related
All formsForgot password
A reset request whose success message deliberately does not confirm whether the account exists.
starter4 variantsSecurity settings
Password change, two-factor management and a session list with a guarded bulk action.
advancedFeatured4 variantsRegister
Account creation with a live password-strength meter that is announced as words, not bars.
intermediateFeatured5 variants