Skip to content

role checkbox

Checkbox draft v0.1.0

Lets people turn one option on or off, or pick any number of options from a list.

A checkbox is a binary choice with a visible label: checked or unchecked, and a third, partially checked look when it stands for a group whose members disagree. Several checkboxes side by side let people pick any number of options; one checkbox alone confirms a statement (accepting terms, remembering a session). A setting that takes effect immediately is a Switch; a choice of exactly one option is a Radio group.

Guidelines

From apps/docs/content/components/checkbox.md

Overview

A checkbox is a binary choice with a visible label. Alone, it confirms a statement (accepting terms, remembering a device). In a list, several checkboxes let people pick any number of options, including none. The box shows the state with a mark, never with color alone: a check when the option is on, a bar when the box stands for a group whose options disagree.

This page applies to every platform. Where a platform differs, the difference sits under a sub-heading named after it (Web, iOS, Android, Desktop); everything else holds everywhere.

When to use

  • Choosing any number of options from a short list (filters, permissions, notification topics).
  • Confirming a statement before continuing (terms of service, consent).
  • A setting that is saved with the rest of a form, when people submit it.

When not to use

  • Exactly one choice among several. Use a Radio group: it says that the options exclude each other.
  • A setting that takes effect immediately, without a Save button. Use a Switch.
  • A long list of options. Use a Select with multiple selection, or a searchable list.

Sizes

Size Use for
Small Dense lists, tables and filter panels, with a 14 px label.
Medium Forms and settings, the default, with a 16 px label.

The box, its corner radius, the label and the description scale together. The exact values are tokens (Tokens tab). Never mix sizes within one list.

Label and description

The label names the option and is the accessible name of the control. Activating it toggles the box, so the whole row is the target. The description adds help under the label: what checking the box does, or why it cannot change. It is read by assistive technology as the control’s description, after the name.

States

State How it happens What changes
Default Resting, unchecked. An outlined, empty box.
Hover A pointer rests over the box or the label. Needs a pointing device: there is no hover on touch. The empty box takes a light tint. A checked box does not change.
Focus visible Keyboard focus on the box. The shared focus ring appears outside the box. Pointer focus shows no ring.
Checked checked property. The box fills with the brand color and shows a check mark.
Indeterminate Set by the application when the box stands for a group of options of which some are on. The box fills and shows a bar instead of a check. Toggling it checks or unchecks the whole group.
Invalid invalid property, after validation. The box border takes the error color; the form states the error in text.
Disabled disabled property. Box, label and description drop to the shared disabled colors, checked or not.

A checkbox cannot be in two states at once from the tokens’ point of view: a checked box keeps its checked colors on hover, and a disabled box keeps its disabled colors whether it is checked or not. The states matrix shows every combination the design decides.

Web

The indeterminate state has no HTML attribute: it is the indeterminate property of the input, set by script. The reference implementation styles the state; the application sets it.

Content

  • State the option positively, as what happens when the box is checked: Send me a weekly summary, never Do not send me a summary.
  • Sentence case, no trailing punctuation. Keep the label to one line; details go to the description.
  • A required checkbox says what is agreed to in its label (I accept the terms of service), and its error message says what to do (Check the box to continue).

Accessibility

The Specification tab lists the full accessibility contract, grouped into what holds on every platform and what is specific to one. Each statement there links the source it comes from. This section explains the decisions behind it.

Web

iOS

Android

  • Switch (a setting that takes effect immediately)
  • Radio group (exactly one choice)
  • Select (one choice among many options)