Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.
Examples
$refs.firstTab.focus())"
>
Options
Label
Checkboxes should always have a label. When the label is not defined, a checkbox becomes standalone. Standalone checkboxes are only used when their connection to other components is clear and they give sufficient context — for example, in application panels.
Selection
Checkboxes can be selected, not selected, or in an indeterminate state. They are in an indeterminate state when they represent both selected and not selected values.
Primary
By default, checkboxes are not emphasized. This version is optimal for when the checkbox is not the core part of an interface, such as in application panels, where all visual components are monochrome in order to direct focus to the content. The Primary, or emphasized, version provides a visual prominence that is optimal for forms, settings, lists or grids of assets, and other situations where a checkbox needs to be noticed.
Bordered
The Bordered variant provides a higher level of visual prominence that is best for situations such as a questionnaire or survey where a checkbox group is the primary component on a page. These work particularly well on touch screen devices as the target area is more clearly visible.
Disabled
A checkbox 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.
Error
Checkboxes 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. For example, in a form that requires a user to acknowledge legal terms before proceeding, the checkbox would show an unchecked error to communicate that it needs to be selected.
Read Only
Checkboxes have a read-only option for when they’re in the disabled state but still need their labels to be shown. This allows for content to be copied, but not interacted with or changed.
Optional
Checkboxes can be marked as optional, depending on the situation. Optional checkboxes are denoted with text added to the end of the label — “(optional)”.
Behaviors
Keyboard Focus
A checkbox can be navigated using a keyboard. The keyboard focus state takes the checkbox’s visual hover state and adds a ring to the checkbox in focus, copying the color style of the variant.
Text overflow
When the label is too long for the horizontal space available, it wraps to form another line.
Conditional content
Checkbox items when checked can reveal additional, conditional content.
$refs.secondTab.focus())"
>
Implementation
Example Name
Description and implementation notes
<p> code example </p>
$refs.thirdTab.focus())"
>
Information
Checklist
All interactive states
Includes all interactive states that are applicable (hover, down, focus, keyboard disabled).
All Color Schemes
Works properly across all color schemes (light, dark).
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).
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).