Skip to main content
Official government website

Label

Names the field it sits above. Every form control needs one.

Examples
HTML and React
Group
Form elements
On this page

Preview

Label with hint text
Open in new tab

The Label component names the field it sits above, so users know what answer is expected before they start typing. Every form control (input, select, text area, checkbox, or radio) needs a visible label.

Usage

When to use

  • Use a visible label for every form control.
  • Use a legend instead when one question describes a group of related controls.

When not to use

  • Do not use placeholder text as a replacement for a label.
  • Do not use a label as a container for long instructions or unrelated content.

Best practices

Connect the label to its control

Match the label’s for value to the control’s id. This lets users select the label to focus the control and gives assistive technology a reliable name.

Write short, direct label text

Use sentence case, put the important words first and do not end labels with a colon. Put examples, format rules and explanations in hint text instead.

Writing label text

Write labels as short noun phrases, such as “Email address”, rather than questions or instructions. Keep the label focused on naming the field. Put any extra detail, such as an expected format or example, in hint text instead.

Pairing with hint text

Use hint text (.govbb-hint) beneath the label to explain a format or give an example, such as “It is on your national ID card”. Link the hint to its control with aria-describedby so it is announced alongside the label.

Label without hint text
Open in new tab

Marking optional fields

Most fields on a government form are required, so required fields carry no mark. Never use asterisks. When a field is genuinely optional, say so in the label with a muted “(optional)” suffix.

Optional field
Open in new tab
  • Use “(optional)” only when most fields in the form are required. If most fields are optional, question the form before questioning the labels.
  • Be consistent within a form: mark every optional field or none.
  • A field with no indicator is assumed required, so make sure it really is.
  • The indicator does not validate anything. Pair it with the required attribute on the controls that must be filled in; the suffix sits inside the label, so screen readers announce it with the field name.

Grouping controls

Use only one label per control. To name a group of related controls, such as a set of checkboxes or radio buttons, use a <fieldset> with a <legend> instead of a label. This frames the question for the whole group rather than a single field.