Skip to example

Plugin example

Registration form with accessible password feedback

A team signup form combines native HTML constraints, A11y Form Validator error handling, and this package's local password-strength meter without sending or storing password values.

Scenario

Create a workspace account draft

A developer wants validation errors, a focusable error summary, and password-strength guidance to work together on a semantic registration form. The example stops at local validation; no account is created.

Try it

Validation and strength checks

Example

Register form

The form uses real labels, native constraints, A11y Form Validator for errors, and a data-root password meter beside the password input.

Use 3 to 24 characters.

Aim for at least 12 characters with mixed case, a number, and a symbol.

Password strength: Not rated

  • Needed At least 12 characters
  • Needed Includes an uppercase letter
  • Needed Includes a lowercase letter
  • Needed Includes a number
  • Needed Includes a symbol

Re-enter the password so the validator can check both fields.

No registration has been submitted.

Accessibility notes

What to inspect

Developer notes

Copy path

Selectors and CSS

  • Password meter root: [data-a11y-password-strength-meter].
  • Observed input: data-input-id.
  • Feedback hook: data-feedback-id plus aria-describedby.
  • Validator root: [data-a11y-form-validator].
  • Import a11y-password-strength-meter/styles.css and a11y-form-validator/styles.css in app code.

Initialization

import { initPasswordStrengthMeters } from "a11y-password-strength-meter";
import {
  createDefaultPreset,
  createFormValidator
} from "a11y-form-validator";

initPasswordStrengthMeters();

createFormValidator(form, {
  ...createDefaultPreset(),
  validateOn: ["submit", "blur", "input", "change"]
});

Limitations

Local guidance only

This example demonstrates UI guidance and client-side validation. A real registration system still needs backend validation, rate limits, account creation, credential storage controls, and security review. The demo intentionally does not submit, store, log, or transmit password values.