Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

PasswordStrength

  • Stable
  • WCAG 2.2 evidence
  • RTL

Shows how strong a new password is: four bars and a text label under the password field. Built on React Aria Meter: role="meter" with aria-valuenow 0 to 4 and the label as aria-valuetext (WCAG 4.1.2). The level is said in words and by the number of filled bars, never by colour alone (1.4.1). Changes are announced politely once typing pauses (4.1.3); the first render is not announced. Consumer duties: computing strength; label wording that matches your policy; putting the component right after the password field. Not for sign-in forms.

import { PasswordStrength } from "@nexera-ui/react";
Loading example…
3
examples
8
props
1
live controls
1
platform
6
WCAG criteria
2
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
strength
Generated code
import { PasswordStrength } from "@nexera-ui/react";

<PasswordStrength />

Examples 2

The same examples as Storybook, rendered live. Open Code to copy one.

With password field

Under a new-password field: the level is announced politely once typing pauses.

Loading example…

Long label and right to left

Labels wrap instead of truncating, and the bars fill from the inline start in right-to-left layouts.

Loading example…

Props 8

Press "Try it" on a card to load that prop into the playground.

8 props shown

strengthNexera
"empty" | "weak" | "fair" | "good" | "strong"

Level to show. Compute it in your app from your password policy (length, character classes, breach lists); the component only displays it. Four bars fill one by one and the label states the level in words.

Default empty
labelsNexera
Partial<Record<PasswordStrengthLevel, string>>

Text of the label for each level, shown under the bars and used as the meter's aria-valuetext. Defaults to the Figma texts: "Use 12 or more characters" (Empty; match it to your policy), "Weak password", "Fair password", "Good password", "Strong password". Translate them.

Default –
aria-labelNexera
string

Accessible name of the meter. Figma shows no visible name; pass aria-labelledby to use visible text instead (the default name is then dropped). Translate it.

Default "Password strength"
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style of the root.

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –
aria-labelledbyReact Aria
string

Identifies the element (or elements) that labels the current element.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

4 direct · 2 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly
  • 4.1.3Status MessagesLevel AA · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<PasswordStrength className="shadow-sm" />

Used in blocks

Related components