If you answer yes, we store and analyse information that helps us improve the website. You can change your choice at any time at the bottom of the page. More about what we store and why.

We also store necessary information that cannot be opted out of. This makes the website work and keeps it secure.

Skip to main content

What are you looking for?

Try searching for…

Components

Label

Label functions as a clear and accessible text label that tells the user what an associated form element is about.

We are working to improve the accessibility documentation for this component. If you have questions or see something that should be prioritised, please contact us on Github or Slack.

A <label> must always be associated with a form element to ensure good accessibility. This is done by using the for attribute (htmlFor in React), which points to the id attribute of the corresponding form element.

Edit this page on github.com (opens in a new tab)