Checkbox (web component)
Checkboxes indicate whether an option, sometimes part of a group of related options, has been selected.
Also known as: bounded checkbox, check box, selection control, tick box, check box group, multi-select checkbox, multi-select option
Looking for the HTML version? See Checkbox (HTML)
<bolt-checkbox-group label="Group label goes here">
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
<bolt-checkbox value="agree" required>I agree to the terms and conditions set forth above.</bolt-checkbox>
Alternate States
Permalink to "Alternate States"<bolt-checkbox-group label="Group label goes here" required error="Please choose an option below">
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
<bolt-checkbox-group label="Group label goes here" required invalid>
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
<bolt-checkbox-group label="Group label goes here" disabled>
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
<bolt-checkbox-group label="Group label goes here">
<bolt-checkbox value="1" disabled>Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Optional features
Permalink to "Optional features"Toggle
Permalink to "Toggle"<bolt-checkbox-group label="Group label goes here" showtoggle>
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Descriptive text
Permalink to "Descriptive text"<bolt-checkbox-group label="Group label" optionaltext="hide">
<bolt-checkbox value="1" description="Label description. Plain text ONLY, no inline formatting. No links or images.">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2" description="Label description. Plain text ONLY, no inline formatting. No links or images.">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Contextual help
Permalink to "Contextual help"Help text body content
<bolt-checkbox-group label="Group label goes here">
<bolt-contextual-help slot="help" heading="Help text heading">
<p>Help text body content</p>
</bolt-contextual-help>
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Appearance options
Permalink to "Appearance options"Labels
Permalink to "Labels"<bolt-checkbox-group label="Non-required checkbox group" optionaltext="hide">
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Bounded version
Permalink to "Bounded version"<bolt-checkbox-group label="Group label" bounded>
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
<bolt-checkbox value="1" bounded>Item label</bolt-checkbox>
The web component implementation reduces the need for explicitly-defined behavioral logic. However, it provides limited control over the underlying HTML markup.
If you require maximum control over the HTML markup, check out the HTML implementation.
The checkbox component is composed of two custom elements: <bolt-checkbox-group> and <bolt-checkbox>:
<bolt-checkbox-group label="Group label goes here">
<bolt-checkbox value="1">Item 1 label</bolt-checkbox>
<bolt-checkbox value="2">Item 2 label</bolt-checkbox>
<bolt-checkbox value="3">Item 3 label</bolt-checkbox>
</bolt-checkbox-group>
Checkbox group
Permalink to "Checkbox group"The bolt-checkbox-group component provides a wrapper around native <fieldset> and <legend> elements, applying a label (via the label attribute) to the set of bolt-checkbox components, which wrap native <input> and <label> elements and apply appropriate layout and data access APIs. The two components should be used together when multiple checkboxes are used. A single bolt-checkbox can also be used by itself.
The bolt-checkbox-group element must include one of these three parameters:
label: The label text, used to populate the underlying<legend>element.arialabel: Sets thearia-labelattribute of the underlying<input>element.arialabelledby: Sets thearia-labelledbyattribute of the underlying<input>element.
Additionally, the bolt-checkbox-group element supports the following parameters:
instructionaltext: optional. The instructional text to display below the label. This should be used to give users additional information about the checkbox group.required: optional. If not present, the group is marked as (optional). Therequiredparameter should also be set at thebolt-checkboxlevel for any checkboxes in the group that require a response.optionaltext: optional.show(default) orhide. Use to remove the "(optional)" text from non-required fields.disabled: optional. If present, disables rendered interactive elements.error: optional. The error message to display.- Should not be used when component is
disabled. For slotted field error see checkbox error slot
- Should not be used when component is
invalid: optional. If present, the group appears invalid.showtoggle: (optional): If present, displays the "Select all" / "Select none" option.bounded: optional. If present, all checkboxes in the group appear with a bounded border.
The <bolt-checkbox-group> element supports the use of bolt-contextual-help via the help slot placeholder. For more information and to see other options visit the contextual help page.
The <bolt-checkbox-group> custom element emits the following events:
bolt-select-all: emitted when the 'select all' control is clicked.bolt-select-none: emitted when the 'select none' control is clicked.
Checkbox
Permalink to "Checkbox"The bolt-checkbox component supports the following attributes:
name: optional. The form field'snameattribute.value: required. The value of the checkbox button.disabled: optional. If present, disables rendered interactive elements.error: optional. The error message to display. Should only be used on a single checkbox when used outside of abolt-checkbox-group.- Should not be used when component is
disabled.
- Should not be used when component is
checked: optional. If present, the control is checked.required: optional. If present, therequiredattribute is passed to the<input>element associated with that checkbox.arialabel: optional. An alternative label for screen reader usage that is not visible on the page. Screen readers will not read slotted content inside abolt-checkboxelement ifarialabelis used.arialabelledby: optional. Theidof an element containing label text for the input. It can accept multipleids to point to other elements of the page using a space separated list. Ifarialabelledbyis used, screen readers will not read slotted content inside abolt-checkboxelement or text fromarialabel.invalid: optional. If present, the control appears invalid.datatestcheckboxoptional property to configure thedata-testvalue on the underlying<input>element. Default ischeckbox.description: optional. Property adds descriptive text to an individual checkbox.- Must be plain text.
bounded: optional. If present, checkbox appears with a bounded border.- If the checkbox is part of a group,
boundedshould be applied to<bolt-checkbox-group>instead.
- If the checkbox is part of a group,
Internals
Permalink to "Internals"Test selectors
Permalink to "Test selectors"- <bolt-checkbox>
[data-test="checkbox"]targets primary <input> element.- Configurable via the
datatestcheckboxproperty
- Configurable via the
General guidelines
Permalink to "General guidelines"- Order individual Checkbox labels logically.
- Lengthy text may wrap.
- Checkbox group validation should occur upon submission of the parent form. Single Checkbox validation can occur after selecting the Checkbox or upon submission of the parent form.
- Checkbox group options should be stacked vertically.
- Consider using "select all" functionality in a Checkbox group based on context/content.
- Error messages should be displayed below a Checkbox group's legend or below the input and label of a single Checkbox.
- Avoid displaying more than one error message at a time. This can lead to user confusion.
When to use
Permalink to "When to use"- Consider a Checkbox when the user can select 0, 1, or multiple values from a predefined list.
- Consider a Checkbox when form submission is needed.
- Consider a single Checkbox for user confirmation, e.g., "I agree to…" or "I have read…".
When not to use
Permalink to "When not to use"- Avoid using Checkboxes for revealing or hiding other screen components.
- Avoid long lists of Checkboxes. Aim to keep the list to 7 options or under.
When to use something else
Permalink to "When to use something else"- Consider using a Switch for immediate actions that do not require reviewing or confirming.
- Consider a Radio button or a Select if users need to make a single, mutually-exclusive selection from two or more options.
Do
- Use the indeterminate state when the Checkbox contains a sub-list of selections.
- Align the Checkbox on the left side of the first line of a left-justified field label.
- Use Checkboxes when form submission is needed.
- Use a single Checkbox for user confirmation, e.g., "I agree to…" or "I have read…".
Don't
- Don't use Checkboxes for triggering navigation or immediate actions.
- Don't use Checkboxes for revealing or hiding other screen components.
Content guidelines
Permalink to "Content guidelines"- Write labels as statements that the checked state makes true, and the unchecked state makes false.
- Avoid using negative phrasing for labels.
- Use sentence case for Checkbox group labels and individual Checkbox labels.
- Ending punctuation is not needed for individual Checkbox labels.
Accessibility compliance
Permalink to "Accessibility compliance"-
WCAG 2.2 Compliant
-
JAWS 2025 Tested
-
NVDA 2025 Tested
-
VoiceOver Tested
-
Keyboard Tested
-
aXe Tested
Keyboard interactions
Permalink to "Keyboard interactions"- Each checkbox should be accessible via the Tab key.
- While focused, pressing Space should toggle between checked and unchecked.

Accessibility issues
Permalink to "Accessibility issues"Voice over
Permalink to "Voice over"- Safari + Voice over may not read descriptive text automatically and instead announce that more content is available.
All Bolt components have gone through accessibility testing, but please keep our accessibility guidelines in mind.