Password strength meter
Presentational four-segment strength indicator with a right-aligned label. Pair with your own password policy or zxcvbn-style scoring in app code.
Medium
<VStack className="w-full max-w-sm" gap={3}> <PasswordStrengthMeter strength="medium" /></VStack>Usage
import { PasswordStrengthMeter } from "@reva/ui";<PasswordStrengthMeter strength="medium" />Pass a PasswordStrengthLevel from your signup or settings flow; the component does not inspect the password string itself.
Examples
All levels
Default English labels: Empty, Low, Medium, Strong, Very strong. Override with label when localising.
Empty
Low
Medium
Strong
Very strong
<VStack className="w-full max-w-sm" gap={3}> <PasswordStrengthMeter strength="empty" /> <PasswordStrengthMeter strength="low" /> <PasswordStrengthMeter strength="medium" /> <PasswordStrengthMeter strength="strong" /> <PasswordStrengthMeter strength="veryStrong" /></VStack>With password field
Typical pairing: a controlled password InputGroup (show/hide) with PasswordStrengthMeter directly underneath, driven by the same string you send on submit. This demo mirrors apps/auth signup (getPasswordStrength); swap in zxcvbn or server rules in your app.
The preview disables password-manager-friendly autocomplete and sets common extension data-* hints only so vault UIs don’t steal focus or cover the meter — do not copy that for real forms; use normal autoComplete (see note under the demo).
Empty
Demo only: autocomplete and extension hints are tuned so password managers don’t get in the way in this preview. In production, set autoComplete as appropriate (e.g. new-password on signup).
import { PasswordStrengthWithFieldDemo } from "@/components/password-strength-with-field-demo"; <PasswordStrengthWithFieldDemo />Loop demo (animated)
Single meter that steps through empty → low → medium → strong → very strong on a timer so you can see segment fills, colour tier changes, and label motion in one place. For documentation only — wire real strength from your app in production.
Empty
Demo: cycles through levels every 1.8s
import { PasswordStrengthMeterLoopDemo } from "@/components/password-strength-meter-loop-demo"; <PasswordStrengthMeterLoopDemo />Props
| Prop | Type | Default | Description |
|---|---|---|---|
strength | "empty" | "low" | "medium" | "strong" | "veryStrong" | — | Which segments are active and which palette tier fills them. |
label | string | Built-in per level | Optional override for the label below the bar. |
className | string | — | Extra classes on the root. |