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
htmlFor and id.Don't: The words are a span
Night crossing
Cabin: not added
Changes made: 0 · Presses on the words: 0
Do: Each seat type answers its own words
Your berth
Seat type: Reclining seat
Changes made: 0
Don't: Every label reaches the first box
Extras
Ticked: none
Changes made: 0
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
Checkboxwithid="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 sameonCheckedChange. - The question Seat type is the
<legend>of aFieldSetaround aRadioGroup, as FRM-010 advises. EachRadioGroupItem, Reclining seat and Cabin bed, has its ownLabeltied to itsid, so a tap on Cabin bed picks that option. - In a list of options built with
.map(), build eachidfrom the item's key or fromuseId(), so every label reaches its own control. - In shadcn's
Form, keep theFormLabelin the sameFormItemas theFormControl; it gets the righthtmlForby itself. TheFieldcomponent withFieldLabeldoes 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-labeland leave the visible text as plain text. FRM-010 may be met; this rule is still broken. - Give every mapped
Checkboxtheid"option", so each label ticks the first box. - Fake it with an
onClickon the rowdiv. 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
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Supports | 1.3.1 Info and Relationships |
| WCAG 2.2 | Law | Supports | 2.5.8 Target Size (Minimum) |
| Material Design | Judge | Supports | Checkbox: accessibility Radio button: accessibility Radio button: guidelines |
| Apple Human Interface Guidelines | Judge | No position | |
| Carbon Design System | Judge | Supports | Radio button: usage Checkbox: usage |
| GOV.UK Design System | Expert witness | No position | |
| Nielsen Norman Group | Expert witness | Supports | Checkboxes 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
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.