Conformance
Field meets WCAG 2.2 level AA when used as described on these pages. It adds structure; the controls inside bring their own keyboard support.
What Field gives you
role="group"on each field, and a native<fieldset>with<legend>forFieldSet, so a group of checkboxes or radios has a name.FieldLabelis a native<label>.FieldErrorhasrole="alert": when it appears, screen readers read it.- Labels in
color.text, help text incolor.text.subtle, errors incolor.text.danger.
What your team does
- Set
foron the label andidon the control. - Link help text and the error with
aria-describedbyon the control, and setaria-invalid="true"on an error. - Use
FieldSetandFieldLegendfor a group of checkboxes or radios. - Write errors that say how to fix the problem. Show them after people leave the field or submit, not while they type the first character.
WCAG criteria
| Criterion | Level | How |
|---|---|---|
| 1.3.1 Info and Relationships | A | <label>, <fieldset>, <legend>, aria-describedby |
| 3.3.1 Error Identification | A | Error in words, linked to the control |
| 3.3.2 Labels or Instructions | A | Label and help text |
| 3.3.3 Error Suggestion | AA | The message says how to fix it |
| 4.1.3 Status Messages | AA | role="alert" on the error |