Password strength meter
A password field that ticks its rules live, measures strength and can be shown or hidden with an accessible button.
- Tailwind
- React
- CSS
- WordPress
Description
When creating an account, users see straight away what is expected: four rules (12 characters, upper and lower case, a digit, a special character) are ticked as they type and a four-segment meter goes from weak to excellent, in red, orange then green, with the level written in words so it never depends on colour alone. The “Show” button reveals the field (aria-pressed, aria-controls) and hides it again on submit. On submit, an invalid e-mail or an incomplete password gets focus, aria-invalid and a message linked with aria-describedby; otherwise a role="status" region confirms. The rules are linked to the field, each announces “met” or “to do” to screen readers, and the level is read through a polite aria-live region. Without JavaScript the field and rules stay usable; the button and the meter only appear with the script. Rules are edited in a tests object, and autocomplete="new-password" lets password managers suggest their own. AA contrast in light and dark mode, 44 px targets, transitions removed with prefers-reduced-motion.
Code
Loading the code…
The code of this component in
Archive contents
mot-de-passe-robustesse-html-tailwind.zip3 files · 6 Ko
- index.html10 Ko
- README.md4 Ko
- LICENSE.md1 Ko
Tags
Updated on December 2, 2026.
Reviews
No reviews yet.
In the same spirit

A recruitment form for small businesses: target position, introduction, CV checked in the browser and GDPR consent, with inline errors.
- Tailwind
- React
- CSS
- WordPress

A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.
- Tailwind
- React
- CSS
- WordPress

Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.
- Tailwind
- React
- CSS
- WordPress

A short NPS survey: a 0 to 10 score as radio buttons, then a follow-up question adapted to whether the customer is a detractor, passive or promoter.
- Tailwind
- React
- CSS
- WordPress