Checkbox group

Version 4.0.0

A checkbox group is a grouping of checkboxes that are related to each other.

A key example of a checkbox group, showing help text description and error message. Required checkbox group, label Interests. 3 checkboxes, labels Travel, Music, Shopping. Help text description in grey, Select at least one interest. Error message text in red with error icon, Select at least one interest.
DateVersionSpectrumExpress UI KitFeb 24, 20234.0.0In progressIn progressSep 08, 20223.0.1DownloadDownloadApr 06, 20223.0.0DownloadFeb 07, 20222.0.0DownloadOct 18, 20211.0.0Download

Anatomy#

Diagram showing the component parts of a checkbox group, including its Field label, checkbox area, and help text.

Options#

Key example of a checkbox group with a field label. Label, Interests. 3 checkboxes, labels Travel, Music, Shopping.

Label#

Checkbox groups should always have a label. In rare cases where context is sufficient and an accessibility expert has reviewed the design, the label could be undefined. These checkbox groups without a visible label should still include an aria-label in HTML (depending on the context, “aria-label” or “aria-labelledby”).

2 key examples of checkbox groups showing label position options. First example, top label position. Label, Interests. 3 checkboxes, labels Travel, Music, Shopping. Second example, side label position, with the label to the left. Label, Interests. 3 checkboxes, labels Travel, Music, Shopping.

Label position#

Labels can be placed either on top or on the side. Top labels are the default and are recommended because they work better with long copy, localization, and responsive layouts. Side labels are most useful when vertical space is limited.

Key example of 2 checkbox groups showing vertical and horizontal orientation. First example, vertical orientation. 2 checkboxes stacked vertically. Field label, Interests. 2 checkboxes, labels Travel, Music. Second example, horizontal orientation. 2 checkboxes placed horizontally. Field label, Interests. 2 checkboxes, labels Travel, Music.

Orientation#

Checkbox groups can be either horizontal or vertical. By default, checkbox groups are vertical. Use a horizontal checkbox group when vertical space is limited.

Key example of 2 checkboxes showing different sizes. First example, small size. Field label, Interests. 3 radio buttons, labels Travel, Music, Shopping. Description, Select at least one interest. Second example, extra-large size. Field label, Interests. 3 radio buttons, labels Travel, Music, Shopping. Description, Select at least one interest.

Size#

Checkbox groups come in four different sizes: small, medium, large, and extra-large. The medium size is the default and most frequently used option. Use the other sizes sparingly; they should be used to create a hierarchy of importance within the page.

The field label, checkboxes, and help text all conform to the same sizing option.

Key example of 3 checkbox groups showing required or optional marks. First example, optional. Field label, Interests (Optional). 3 checkboxes, labels Travel, Music, Shopping. Description, Select at least one interest. Second example, required. Field label, Interests (Required). 3 checkboxes, labels Travel, Music, Shopping. Description, Select at least one interest. Third example, required. Field label, Interests. Label includes an asterisk icon. 3 checkboxes, labels Travel, Music, Shopping. Description, Select at least one interest.

Required or optional#

Checkbox groups can be marked as optional or required, depending on the situation. For required checkbox groups, there are two styling options: a “(required)” label or an asterisk. If you use an asterisk, be sure to include help text to explain what the asterisk means. Optional checkbox groups are either denoted with text added to the end of the label — “(optional)” — or have no indication at all.

The asterisk used in this component is an icon that has specific spacing from the label text — not part of the label text itself.

Key example of a checkbox group showing an error. Required field label, Interests. 3 checkboxes, labels Travel, Music, Shopping. Error message in red with error icon, text Select at least one interest.

Error#

Checkbox groups can be marked as having an error to show that a selection needs to be made in order to move forward, or that a selection that was made is invalid. The error is indicated with negative help text, along with an icon.

Key example of a checkbox group in a disabled state. Required field label, Interests. 3 checkboxes, labels Travel, Music, Shopping. Description text in grey, Select at least one interest. Radio group is faded in grey color to show that it can’t be interacted with.

Disabled#

A checkbox group in a disabled state shows that a selection exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that an action may become available later. The field label, checkboxes, and help text are all displayed in a disabled state when the checkbox group is disabled.

Key example of a read-only checkbox group consisting of three checkboxes stacked vertically. Checkbox group label, Interests. Checkbox labels, Travel, Music, Shopping. None of the checkboxes are selected. The last checkbox, label Shopping, shows an arrow cursor hovering over and highlighting the label text in blue, to copy it.

Read-only#

A checkbox group has a read-only option for when it's in the disabled state but still needs to be shown. This allows for content to be copied, but not interacted with or changed.

2 key examples of radio groups showing help text. First example, required field label, Interests. 3 checkboxes, labels Travel, Music, Shopping. Description text in grey, Select at least one interest. Second example, required field label, Interests. 3 checkboxes, labels Travel, Music, Shopping. Error message in red text with error icon, Select at least one interest.

Help text (description and error message)#

Checkbox groups should use help text for error messaging and descriptions. Descriptions are valuable for giving context behind why a selection is required, or for clarifying the options.

Table of options#

From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.

PropertyValuesDefault Valuelabeltext / nothing-label positiontop / sidetopnecessity indicatortext / icon / nothingiconis requiredyes / nonoorientationhorizontal / verticalverticalis erroryes / nonois disabledyes / nonois read-onlyyes / nonodescriptiontext / nothingnothingerror messagetext / nothingnothing

Composition#

Key example showing the composition of a checkbox group. The checkbox area is located between the field label and the help text.

Checkbox area#

This area is reserved for checkboxes that represent the selection options for the checkbox group.

Internationalization#

Key example showing how a checkbox group appears in Arabic, with UI mirrored. Required checkbox group, label Interests. 3 radio buttons, labels Travel, Music, Shopping. Help text description, Select at least one interest.

RTL#

For RTL (right-to-left) languages, the layout of the checkbox group (and its components) is mirrored. The checkmarks and icons are placed on the right side of the text, and text is aligned to the right.

Keyboard interactions#

KeyInteractionTabMoves focus to previous or next checkbox in the checkbox group. Does not loop when the last or first checkbox is reached.SpaceToggles the checkbox between selected and not selected. If the checkbox is initially partially selected, the checkbox becomes selected first, and subsequent toggles alternate normally between selected and not selected.

Changelog#

DateNumberNotesFeb 24, 20234.0.0
  • Updated read-only option design
Sep 08, 20223.0.1
  • Updated disabled text color (from gray-500 to gray-400)
Apr 06, 20223.0.0
  • Updated all colors to 6.0.0
Feb 07, 20222.0.0
  • Updated read-only option design
Oct 18, 20211.0.0
  • This component has been added to the website

Design checklist#

N/A

All interactive states

Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

N/A

All color themes

Works properly across all four color themes (lightest, light, dark, darkest).

N/A

All platform scales

Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

check

Accessible use of color

Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

check

Accessible contrast for text

Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

check

Accessible contrast for UI components

Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

N/A

Content design

UI language and information design considerations have been incorporated into component design.

check

Defined options

Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

N/A

Defined behaviors

Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

N/A

Usage guidelines

Includes a list of dos and don'ts that highlight best practices and common mistakes.

N/A

Writing guidelines

Includes content standards or usage guidelines for how to write or format in-product content for the component.

check

Internationalization guidelines

Works properly across various locales and includes guidelines for bi-directionality (RTL).

check

Keyboard interactions

Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

unchecked

Design tokens

All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

check

UI kit

Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

unchecked

Generated UI kit

Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

unchecked

In Spectrum for Adobe XD plugin

Component is included in the Spectrum for Adobe XD plugin.