Checkbox Group

Provides shared state to a series of checkboxes.

Apples

Anatomy

Checkbox Group is composed together with Checkbox. Import the components and place them together:

Anatomy

API reference

PropTypeDefault
defaultValue

string[]

undefined

value

string[]

undefined

onValueChange

((value: string[], event: Event) => void)

undefined

allValues

string[]

undefined

disabled

boolean

false

className

| string
| ((state: Checkbox.Group.State) => string)

undefined

render

| ReactElement
| ((props: HTMLProps, state: Checkbox.Group.State) => ReactElement)

undefined

Attribute
Description
data-disabled

Examples

Parent checkbox

A checkbox that controls other checkboxes within a CheckboxGroup can be created:

  1. Make CheckboxGroup a controlled component
  2. Pass an array of all the child checkbox names to the CheckboxGroup’s allValues prop
  3. Add the parent boolean prop to the parent Checkbox

Nested parent checkbox