Selection
Checkbox
A checkbox turns one option on or off, alone or in a group where any number can be chosen, and a parent checkbox selects a whole list at once.
In kanso-ui as Checkbox
Accessibility
- Role and name: a native
<input type="checkbox">inside its<label>, so the label is both the name and the target. - Group: screen readers say the
<legend>when focus enters the<fieldset>. - Mixed: set the parent's
indeterminateproperty from code; HTML has no attribute for it. Screen readers then say "mixed" or "partly checked". - Disabled: tie the reason to the box with
aria-describedby. - Keyboard: Tab moves between boxes and Space toggles.
- Targets: the whole label row, at least 48px (
size-control-lg). - Contrast (light, dark): box border
outlineonpaper3.3 and 5.6:1; checked fillinkonpaper16.7 and 15.9:1; tickon-inkonink16.7 and 15.9:1; labelinkonpaper16.7 and 15.9:1; focus ring 7.3 and 9.0:1. Disabled boxes are exempt, which is why they carry a reason. - Motion: none.