Password strength
How strong a new password is while it is typed, as the Meter's bar and a word, with the rules the form asks for ticked as they are met.
Examples
Default
Put it under a new password’s box, in the same Field, on a sign-up, reset or change form; never on a sign-in or current password. Its rules tick as they are met and describe the box, and userInputs marks a password built on the person’s name, email or your product’s name as weaker. Every check here is a hint: your server enforces the length and checks the password against a breach list, such as Have I Been Pwned, and says why in the Field’s error. Mask it in session replays as you mask the box, since replays record text.
sunshine1A common word with a digitharbour41Under 10 charactersHarbour-41!Under 12 charactersquiet harbour lanternThree wordsLevels
Weak, Fair, Good and Strong, from estimatePasswordScore. Length counts most, and capitals or symbols earn nothing on their own. Weak warns in red below the notch, Fair is amber, and Good and Strong are green. It is a light estimate with no dictionary: a name and a year (“Michelle1990!”) can still read Strong.
Without rules
Leave out rules for the bar and the word alone. For a score that knows names, places and words, pass zxcvbn-ts’s through score.
Installation
npx shadcn@latest add https://kinoui.com/r/password-strength.json- Files
lib/reduce-motion.tslib/track.tscomponents/kino/meter.tsxlib/resize.tslib/choice.tscomponents/kino/checkbox.tsxcomponents/kino/label.tsxlib/settle.tscomponents/kino/field.tsxlib/announce.tsxlib/refs.tslib/swap.tsxcomponents/kino/password-strength.tsx- Packages
@base-ui/react- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
Data attributes
Accessibility
- The bar is a
meternamed bylabel, and its value reads as the level’s word. - A screen reader doesn’t hear a meter change, so a polite status says the level once typing has paused for a second, and only when it changed.
- Inside a Field the rules describe the password box, so they are read when it is focused. A met rule ends with
metLabel, so its state never rests on the tick or the colour. - Weak is red and sits below the notch, Fair is amber and Good and Strong are green, and the word always says the level too.
- In forced colours the fill and the ticked rules take the system highlight.