Skip to content

CheckboxGroup

Several choices out of many. Real checkboxes share one form name, so selections submit natively. Each change dispatchesink:checkboxgroup:change with { values }.

Example

Toppings

Pick any you like.

<CheckboxGroup
  name="toppings"
  label="Toppings"
  options={["Pepperoni", "Mushrooms", "Olives"]}
/>

With objects and error

Notifications

Pick at least one channel.

<CheckboxGroup
  name="notify"
  label="Notifications"
  options={[{ value: "email", label: "Email" }, { value: "sms", label: "SMS", disabled: true }]}
  error="Pick at least one channel."
  required
/>

Props

PropTypeDefaultDescription
namestring-Shared checkbox name; message ids derive from it.
labelstring-Legend text.
optionsArray<string | { value; label; disabled? }>-Selectable items.
valuesstring[][]Preselected option values.
hint / errorstring-Wired via aria-describedby on the fieldset.
requiredbooleanfalseMarks the group required.
disabledbooleanfalseDisables every option.
classstring-Style passthrough.

Accessibility