Skip to content
caliper ui pro docs

Password strength

A new-password field that shows a strength meter and the rules it meets.

Pro

Change password

maya@forma.studio · signs out other devices

No password yet

  • At least 12 characters, not met
  • Uppercase and lowercase letters, not met
  • A number, not met
  • A symbol, not met

Last changed 94 days ago.

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

terminal
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.

PropTypeDefault
labelstring"New password"
rulesreadonly PasswordRule[]passwordRules
onValueChange((value: string, strength: PasswordStrengthResult) => void)—
messages{ show?: string | undefined; hide?: string | undefined; }—

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.md

The index of every part is at /llms.txt.

More in Inputs