PasswordStrengthMeter
Inline password-strength bar. Pure-function scorer — no zxcvbn / no
dictionaries — so the bundle stays light. The score reflects four
heuristics that match the auth-server’s default password policy:
length, mixed case, digits, and a small set of symbols. Operators
who run a stricter or laxer policy can pass their own score fn.
Renders nothing when password is empty so the form doesn’t show a
“weak” red bar on first focus.
Composition: callers typically render this inside a password field’s label or just below the input. It’s not opinionated about layout — the consumer’s CSS wraps it.
Usage
import { PasswordStrengthMeter } from '@rw3iss/auth-client/preact/atoms';
<PasswordStrengthMeter password={"password"}/>Props
| Name | Type | Description |
|---|---|---|
password | string | (required) |
score | (pw: string) => number | Custom scorer. Receives the raw password, returns 0–4. |
barOnly | boolean | Hide the score label (just the bar). Default false. |
className | string |