CheckboxGroup
Several choices out of many. Real checkboxes share one form name, so selections submit natively. Each change dispatchesink:checkboxgroup:change with { values }.
Example
<CheckboxGroup
name="toppings"
label="Toppings"
options={["Pepperoni", "Mushrooms", "Olives"]}
/>With objects and error
<CheckboxGroup
name="notify"
label="Notifications"
options={[{ value: "email", label: "Email" }, { value: "sms", label: "SMS", disabled: true }]}
error="Pick at least one channel."
required
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | - | Shared checkbox name; message ids derive from it. |
label | string | - | Legend text. |
options | Array<string | { value; label; disabled? }> | - | Selectable items. |
values | string[] | [] | Preselected option values. |
hint / error | string | - | Wired via aria-describedby on the fieldset. |
required | boolean | false | Marks the group required. |
disabled | boolean | false | Disables every option. |
class | string | - | Style passthrough. |
Accessibility
fieldset+legendgives each box its group context.- Tab moves between options; Space toggles each natively.
- Hint and error link via
aria-describedbyon the fieldset.