Skip to content

FRM-016a Let a click on a checkbox's or radio button's text change it, as a click on the box does

Level
Rule
Verdict
Unanimous (2 of 2)
Area
Forms
Status
proposed, version 1.0.0

Rule

When a checkbox or a radio button shows its own text beside it, a click, tap or pen press on that text checks or unchecks the checkbox, or selects the radio button, exactly as a press on the box or circle does.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: The words tick the box

Night crossing

Cabin: not added

Changes made: 0

Click the words Add a cabin for the night crossing, then click the box, or Tab to the box and press Space. Each one changes the cabin and adds one to the count. The label is tied to the box with htmlFor and id.

Don't: The words are a span

Night crossing

Add a cabin for the night crossing

Cabin: not added

Changes made: 0 · Presses on the words: 0

Click the words Add a cabin for the night crossing. Nothing changes: the presses on the words rise and the changes stay at zero, and a line says why. The box still has a name in code, so only this rule is broken. Only a press on the box ticks it.

Do: Each seat type answers its own words

Your berth

Seat type

Seat type: Reclining seat

Changes made: 0

Click Cabin bed, then Reclining seat, on the words and not on the circles. Each press selects that option. Tab to the group and use the arrow keys to move between the options. The question is the legend of the group, and each option has its own label.

Don't: Every label reaches the first box

Extras

Add to your booking

Ticked: none

Changes made: 0

Click the words Priority boarding or Bike space. The first box, Breakfast on board, is ticked or cleared instead, because all three boxes share the id "option". Clicking a box itself still works, which hides the fault.

Why

The box or circle is small, and the words beside it are what people read and aim at. When the words do nothing, a near miss on the box is a lost press, and anyone with a tremor or a large fingertip pays for it most. Making the text respond gives each option a target as wide as its words, with no change to how it looks.

WCAG does not require this. It supports it: the label technique for WCAG 2.2, 1.3.1 Info and Relationships (H44) names the larger click area as an extra gain for people with limited motor control, and a responding label serves the same need as 2.5.8 Target Size (Minimum). Text that does not respond does not by itself fail either criterion. Whether the control has a name in code is FRM-010; whether the box itself is large enough is ACT-006.

Do

  • On a ferry booking form, the checkbox Add a cabin for the night crossing is a shadcn Checkbox with id="cabin" and a <Label htmlFor="cabin"> beside it. A click on the words ticks the box and does everything a click on the box does, firing the same onCheckedChange.
  • The question Seat type is the <legend> of a FieldSet around a RadioGroup, as FRM-010 advises. Each RadioGroupItem, Reclining seat and Cabin bed, has its own Label tied to its id, so a tap on Cabin bed picks that option.
  • In a list of options built with .map(), build each id from the item's key or from useId(), so every label reaches its own control.
  • In shadcn's Form, keep the FormLabel in the same FormItem as the FormControl; it gets the right htmlFor by itself. The Field component with FieldLabel does the same.
  • Wrapping the control and its text in one <label> works too. An option card where the whole card is the label is fine, as long as the card holds no other control.
  • A disabled option stays still when its text is clicked, just as when its box is.

Don't

  • Put Add a cabin for the night crossing in a <span> next to the box, so the words look like a label and do nothing.
  • Name the box with aria-label and leave the visible text as plain text. FRM-010 may be met; this rule is still broken.
  • Give every mapped Checkbox the id "option", so each label ticks the first box.
  • Fake it with an onClick on the row div. A click on the box then toggles twice, and nothing is tied for assistive technology.
  • Put a click handler on the row or the label that toggles the box, so a click on the link cabin prices inside the option's text also ticks it. A plain link in a <label> only follows the link. Nor let a link fill most of the text, which leaves little to click that ticks the box.

Exceptions

  • No text of its own. A checkbox with no visible text beside it, such as one that selects a table row, is outside this rule. Its name in code is FRM-010.
  • Other text. Only the option's own text is meant. A group label, a hint under the option or a heading need not respond.
  • Target size. This rule does not make a small box pass ACT-006. The text counts toward the target only as ACT-006 says.
  • Switches. A switch's text is FRM-016b.

Verdict

Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on FRM-016a
SourceRoleStancePage
WCAG 2.2LawSupports1.3.1 Info and Relationships
WCAG 2.2LawSupports2.5.8 Target Size (Minimum)
Material DesignJudge SupportsCheckbox: accessibility
Radio button: accessibility
Radio button: guidelines
Apple Human Interface GuidelinesJudge No position
Carbon Design SystemJudge SupportsRadio button: usage
Checkbox: usage
GOV.UK Design SystemExpert witness No position
Nielsen Norman GroupExpert witness SupportsCheckboxes vs. Radio Buttons, by Jakob Nielsen

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Forms: 15 rules and 12 guidelines · All rules