Checkbox Group

Provides shared state to a series of checkboxes.

Apples

API reference

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

Anatomy
PropTypeDefault
defaultValue

string[]

undefined

value

string[]

undefined

onValueChange

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

undefined

allValues

string[]

undefined

disabled

boolean

false

className

string | ((state: State) => string)

undefined

render

| ReactElement
| ((props: GenericHTMLProps, state: 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