Skip to content
rw3iss Auth

PasswordStrengthMeter

atom @rw3iss/auth-client/preact/atoms/PasswordStrengthMeter framework-adapters/preact/components/atoms/PasswordStrengthMeter.tsx ↗

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

NameTypeDescription
passwordstring(required)
score(pw: string) => numberCustom scorer. Receives the raw password, returns 0–4.
barOnlybooleanHide the score label (just the bar). Default false.
classNamestring