CheckBoxGroup

a group of checkboxes

CheckBoxGroup is a Box with the following properties preset. You can customize it using the properties available in Box.

Props

disabled

Disables all options.
truefalse

labelKey

When the options array contains objects, this property indicates how to determine the label of each option. If a string is provided, it is used as the key to retrieve each option's label.

"string"

name

Required when used in the Context of Form and FormField.
"string"

onChange

Function that will be called when the user clicks on a CheckBox option. It will pass a React event object with the additional CheckBoxGroup properties of 'option' and 'value'.

({ value, option }) => {...}

options

Options can be either a string or an object of CheckBox props excluding the 'checked' property, use CheckBoxGroup 'value' prop instead of 'checked'.

[
"string"
]
{
""
}

value

An array of the values for the checked options. If options is provided as an object, the value array will be the values that the valueKey maps to.

[
"number""string"
]

valueKey

When the options array contains objects, this property indicates how to determine the value of each option. If a string is provided, it is used as the key to retrieve each option's value.

"string"