Pass the value of any input as value. A rule is { id, label, test }. The built-in scorer runs if you pass no score and no scorer.
new-password-strength.tsx
PasswordStrength
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | "" | The password. The parts read the rules and the built-in score from it. |
| score | PasswordScore | — | A score from your own check (0 to 4, or a zxcvbn-like { score }). Wins over scorer. |
| scorer | scorePassword | Scores value. Default: scorePassword (length, kinds of characters, the rules). | |
| rules | readonly PasswordRule[] | NO_PASSWORD_RULES | The requirements that PasswordStrengthRules lists. |
| labels | PasswordStrengthLabels | PASSWORD_STRENGTH_LABELS | The words for the scores 0 to 4. Default: Very weak, Weak, Fair, Good, Strong. |
| invalid | boolean | false | Shows unmet rules as errors (red, a cross). Set it after the form tried to submit. |
| size | "default""sm" | "default" | sm: word and rules 12/16, icons 14. default: 14/20, icons 16. The track stays 4px. |
| variant | "bar""segments" | "bar" | bar: one Meter track. segments: 5 short bars, score + 1 filled. |
| glow | boolean | — | A soft halo on the fill in its level color (glow, @gelatin-ui/glow). Default: false. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
PasswordStrengthMeter
<div>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
| glow | boolean | — | A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false. | ||||||||||||||||||
From Base UIMeter.RootBase UI docs | |||||||||||||||||||||
| aria-valuetext | string | — | A string value that provides a user-friendly name for aria-valuenow, the current value of the meter. | ||||||||||||||||||
| format | NumberFormatOptions | — | Options to format the value. | ||||||||||||||||||
| get | — | A function that returns a string value that provides a human-readable text alternative for aria-valuenow, the current value of the meter. | |||||||||||||||||||
| |||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||
PasswordStrengthLabel
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
PasswordStrengthRules
<ul>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <ul> attributes | — | Every other attribute goes to the <ul>, with a ref. |
PasswordStrengthRule
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| rule | string | — | The id of the rule (in the rules of the root) that this row shows. |
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
Built with
Installs with Password Strength
- Components
- Meter





