StealThis .dev

Form — Password strength + rules checklist

A set-password field that grades strength in real time with a color-coded four-segment meter while a live requirements checklist ticks off minimum length, uppercase, lowercase, number, and symbol as you type. A show/hide toggle reveals the value, a confirm-password field reports match state, and the submit button stays disabled until the password is strong and both entries agree. Strength is announced politely for screen readers.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Password strength + rules checklist

A self-contained set-password form that gives instant feedback as the user types. A four-segment strength meter shifts from red through amber and blue to green, and a label below it reads out “Too weak”, “Fair”, “Good”, or “Strong”. Underneath, a live requirements checklist ticks off each rule — at least 10 characters, an uppercase letter, a lowercase letter, a number, and a symbol — with a check mark animating in as each is satisfied.

Each password field has its own show/hide eye toggle that flips the input between obscured and plain text while keeping focus, and reports its pressed state through aria-pressed. The confirm field validates the match continuously: it goes green when the two entries agree and red with helper text when they diverge or are left empty after typing.

The submit button only enables when the password meets every rule and the confirmation matches, so there is no fake submit. On success the form swaps to a confirmation panel, and a small aria-live toast announces the result. Strength changes are announced politely, fields expose aria-invalid and aria-describedby, and the layout stacks cleanly down to about 360px.