Getting started
Components
To support internationalization, avoid starting a sentence with the label and using the field to finish it since sentence structures vary across languages. For example, use "Call log expiration date" or "How long should logs be stored?". Don't use "Remove logs after:".
htmlFor
id
Make sure to connect the Label to the Input. This is done with the htmlFor prop on the label, and the id prop on the form field. Those two need to match.
Label
Input
Use required indicators to show users which fields they must fill out.
Use optional prop to show users which fields are optional to fill out.
optional
Use the disabled prop if a the label is associated with a disabled form field to show users that they can't interact with the field.
Use a Label to clearly describe the the form field.
Use Label in composition with a form element.
Don't use Label as a stand-alone component.
Include a visible label on every form field.
Don't use prefix/suffix text as a replacement for a label.
Help us improve this component by providing feedback, asking questions on Slack, or updating this file on GitHub.