Skip to content

Aria Plugin

Adds ARIA accessibility attributes to form fields, enabling screen readers to announce validation errors.

Options

This plugin has no configurable options beyond enabled.

OptionTypeDefaultDescription
enabledbooleantrueEnable or disable the plugin

Playground

When a field is invalid, the input receives aria-invalid="true" and aria-describedby pointing to the error container. When valid, aria-invalid="false" and aria-describedby is removed. The status line below the form shows the current attribute values.

Notes

  • Sets aria-invalid="true" on invalid elements and aria-invalid="false" on valid elements after each validation run.
  • When used alongside the Message plugin, also sets aria-describedby on the field pointing to the error container, and role="alert" on the container so screen readers announce new errors automatically.
  • Works without Message — only aria-invalid is set in that case.
  • For radio/checkbox groups, aria-describedby is set on all elements in the group.
  • Container id and role attributes are cleaned up when a field transitions back to valid.

Released under the MIT License.