For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/checkbox.md.

Checkbox

Collects any number of choices from a limited set, or turns a single option on or off — reach for Radio when only one choice is allowed, and Switch when the change takes effect immediately instead of on submit. Past roughly ten options, a Select reads better than a long column of boxes.

Source · Storybook

Usage

import { Checkbox, CheckboxIndicator, CheckboxLabel } from '@wallarm-org/design-system/Checkbox';

Examples

Checked

The checked state. Pass checked to drive it from your own state, or defaultChecked to let the checkbox keep track of it.

Indeterminate

checked='indeterminate' is for a parent whose children are only partly selected. Set it deliberately — a click never produces it — and clear it once every child is checked or unchecked.

Disabled

All three states while disabled, so you can see that the indicator stays readable when the option cannot be changed.

With description

CheckboxDescription adds a second line under the label, and switches the row to a grid so that text lines up with the label rather than the box.

Group

CheckboxGroup ties several checkboxes to one name and one array of values, and owns the spacing between them. Every box stays independent: ticking one must never move another, unless it is a parent selecting all of its children.

Card

variant='card' gives every option its own bordered surface. Cards exist to carry a description — that is what the extra room is for, and a card holding a bare label wastes it. Plain rows read better for short lists of short labels.

Form field

Wrapped in Field, so the label and description above the options come from FieldLabel and FieldDescription. Shown as plain rows and as cards.

Props

PropTypeDefaultDescription
titlestring | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
htmlForstring | undefined
idstringThe unique identifier of the machine.
formstring | undefinedThe id of the form that the checkbox belongs to.
defaultCheckedCheckedState | undefinedThe initial checked state of the checkbox when rendered. Use when you don't need to control the checked state of the checkbox.
disabledboolean | undefinedWhether the checkbox is disabled
namestring | undefinedThe name of the input field in a checkbox. Useful for form submission.
valuestring | undefinedThe value of checkbox input. Useful for form submission.
idsElementIds | undefinedThe ids of the elements in the checkbox. Useful for composition.
readOnlyboolean | undefinedWhether the checkbox is read-only
requiredboolean | undefinedWhether the checkbox is required
onCheckedChangecomplexThe callback invoked when the checked state changes.
invalidboolean | undefinedWhether the checkbox is invalid
checkedCheckedState | undefinedThe controlled checked state of the checkbox
asChildboolean | undefinedUse the provided child element as the default rendered element, combining their props and behavior.
data-testidstring | undefined

CheckboxDescription

PropTypeDefaultDescription
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

CheckboxGroup

PropTypeDefaultDescription
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring[] | undefinedThe initial value of value when uncontrolled
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
disabledboolean | undefinedIf true, the checkbox group is disabled
namestring | undefinedThe name of the input fields in the checkbox group (Useful for form submission).
valuestring[] | undefinedThe controlled value of the checkbox group
asChildboolean | undefinedUse the provided child element as the default rendered element, combining their props and behavior.
readOnlyboolean | undefinedIf true, the checkbox group is read-only
invalidboolean | undefinedIf true, the checkbox group is invalid
onValueChange((value: string[]) => void) | undefinedThe callback to call when the value changes
maxSelectedValuesnumber | undefinedThe maximum number of selected values
variant{ default: string; card: string; }default

CheckboxLabel

PropTypeDefaultDescription
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
asChildboolean | undefinedUse the provided child element as the default rendered element, combining their props and behavior.

Explorer