Skip to content

role group

Checkbox group draft v0.1.0

Lets people pick any number of options from a short, visible set, under one legend.

A checkbox group shows every option at once, with a legend naming the choice, and lets people check any number of them, including none. It is the grouped form of the Checkbox: the group carries the legend, the shared help text and the error message, and each option its own label, description, value and checked state. Exactly one choice is a Radio group; a long list is a Select.

Guidelines

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

Overview

A checkbox group is the grouped form of the Checkbox: a legend names the set, each option has its own label and can be checked independently, and the group carries the shared help text and the error message. It is built like the Radio group, with one difference that matters: any number of options can be on, including none.

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

  • Several options can be chosen at once from a short list (notification channels, columns to show, days of the week).
  • The options need a common name that one checkbox alone would not carry.

When not to use

  • Exactly one option. Use a Radio group.
  • One option on its own. Use a Checkbox.
  • Many options. Use a Select with multiple selection, or a searchable list.

Orientation and sizes

Orientation and sizes are the Radio group’s: vertical by default, horizontal for two or three short options; small (16 px boxes) or medium (20 px boxes, the default).

States

States belong to the options; the group passes its disabled and invalid properties down to them.

State How it happens What changes
Default Resting, unchecked. An outlined, empty box.
Hover A pointer rests over a box or its 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 a box. The shared focus ring appears outside it. Pointer focus shows no ring.
Checked The option’s checked property, or activation. The box fills with the brand color and shows a check mark.
Invalid The group’s invalid property, after validation. Every box border takes the error color; the error message is shown.
Disabled The group’s disabled property, or an option’s. Box, label and description drop to the shared disabled colors.

Content

  • The legend names the set: Notifications, Which days suit you?
  • Option labels are short, parallel and positive: Email, Push, Text message.
  • Say when a choice is required or limited in the description: Choose at least one, Choose up to three. The error message says what to do.

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

  • Checkbox (one option on its own)
  • Radio group (exactly one option)