Password strength
A new-password field that shows a strength meter and the rules it meets.
When to use
- Account creation and password changes.
- You want live feedback instead of an error after submit.
When not to use
- You are asking for an existing password; use a password field.
Installation
pnpm dlx shadcn@latest add @caliper/password-strength
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
PasswordStrength
4 props
Also accepts the native props of its root element and a ref.
scorePassword
0 props
No props of its own; it accepts the native props of its root element.
passwordRules
helper
A helper exported alongside the component, not a component.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes meter semantics, with aria-label, aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext and aria-hidden kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/password-strength.mdThe index of every part is at /llms.txt.