Component Library

Forms Labels

Issue Description

Form fields are not appropriately associated with their labels or a label is missing.

Recommendation

Give all controls a <label>. This allows all users to understand the type of information expected in the field.

  • Form controls should have unique labels, and should be implemented using native HTML for style and assistive technology access whenever possible.
  • Labels precede the elements which they describe and provide context, and require unique, matching <for> and <id> attributes, not relying on page content for context.
  • Labels can contain the elements they describe, which precludes the need for <for> and <id> attributes.
  • If an element contains both heading and link attributes, remove the heading tags.

https://webaim.org/techniques/forms/controls