Checkbox
A checkbox is an interactive element that allows users to select or deselect an option.
Overview
Checkboxes provide a binary selection mechanism where users can either check the box to indicate they want a particular option or leave it unchecked to indicate they do not want that option.
They are commonly used in forms, settings panels, and various other interfaces where users need to make a single selection.
Dos and Don’ts
Anatomy
- Checkbox input: A checkbox input indicates the appropriate state. By default it is unselected.
- Label (Optional): Describes the information you want to select or unselect.
- Assistive text (Optional): The assistive text provides additional instructional information / error / success messaging.
Variations
Default
Modifiers
Label
A label should always be present unless being utilised as a nested component and an alternative label is present.
Assistive text
Assistive text is used where needed to provide additional information or error / success messaging. The assistive text is always used for an error state to provide the user with the information required to complete the form element.
Content
All content should use sentence case.
Label
- Always use clear and concise labels for checkboxes.
- Labels appear to the right of checkbox input (when the text direction is left-to-right).
Overflow
Multiple words overflow
When the label exceeds the available width, the label will wrap onto a new line.
Behaviours
States
The checkbox input allows for a series of three states: unselected, selected, and partially selected. The default state for a checkbox is unselected.
Use the partially selected state when the checkbox contains a sublist of selections, some of which are selected, and some unselected.
Interactions
Users can trigger the checkbox directly or by clicking the checkbox label. Having all regions interactive creates a more accessible click target.
Interactive states
Outlines the atomic level interactive elements for the component.
Examples
LTR examples
Here are some examples of the component in a left-to-right context:
RTL examples
Here are some examples of the component in a right-to-left context:
Resources
Stable | |
Stable | |
Beta | |
Stable | |
Stable | |
iOS JustUI [UI Kit] | Stable |
iOS PIE [SwiftUI] | Stable |
Android PIE [Compose & Views] | Stable |