Password Strength

A React password field with a four step strength meter and a live rule checklist. Announces the score politely and accepts your own scorer such as zxcvbn.

src/registry/ui/password-strength.tsx/r/password-strength.json

Installation#

bash
npx shadcn@latest add https://ui.minidev.pro/r/password-strength.json

Usage#

tsx
import { PasswordStrength } from "@/components/ui/password-strength"

export function Example() {
  return <PasswordStrength />
}

API reference#

PasswordStrength props
PropTypeDefault
valuestring-
defaultValuestring""
onChange(value: string) => void-
rulesRule[]DEFAULT_RULES
score(value: string) => number-
labelstring"Password"
idstring-
classNamestring-

Dependencies#

npm

lucide-react

Built from

All form components