Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

CheckboxGroup

CheckboxGroup is used to group related checkboxes.

Import

Usage

Uncontrolled checkbox group

EDITABLE EXAMPLE

Controlled checkbox group

EDITABLE EXAMPLE

Group orientation

Make a set of checkboxes appear horizontal stacked rather than vertically, by adding direction="row" to the Stack component.

EDITABLE EXAMPLE

Colors

Use the variantColor prop to change the color scheme of the Radio. variantColor can be any color key with key 50(hover), 60(checked) that exist in the theme.colors.

EDITABLE EXAMPLE

Sizes

Use the size prop to change the size of the CheckboxGroup. You can set the value to sm, md, or lg.

EDITABLE EXAMPLE

States

EDITABLE EXAMPLE

Asynchronous data loading

EDITABLE EXAMPLE

Props

NameTypeDefaultDescription
namestringThe name used to reference the value of the control. If you don't provide this prop, it falls back to a randomly generated name.
valueArray<Checkbox['value']>The value of the checkbox group.
disabledbooleanfalseIf true, all checkboxes will be disabled.
variantColorstringThe color of the checkbox when it's checked. This should be one of the color keys in the theme (e.g. 'green', 'red')
sizestring'md'The size (width and height) of the checkbox. One of: 'sm', 'md', 'lg'
defaultValueArray<Checkbox['value']>The initial value of the checkbox group.
childrenReactNodeThe content of the checkbox group. Must be the Checkbox component.
onChangefunctionA callback fired when any descendant Checkbox is checked or unchecked.