Multi-choice form control group with option items, field text, and one canonical values-change event.
Install @wyrd-company/react or the Flutter package and use it directly —
your DESIGN.md does the styling.
catalog/contracts/checkbox-group.ymlsource of truth · verbatim
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity:name: CheckboxGrouptag: wyrd-checkbox-grouppackage: wyrd.component.checkbox-grouptitle: Checkbox Groupsummary: Multi-choice form control group with option items, field text, and one canonical values-change event.relationships:related-to: - quality-parity-and-gatesclassification:category: form-fieldcomposition: multi-slotinteractive: truetarget-strategy:react: requiredflutter: requiredsurface:properties: - name: valuestype:kind: arrayitem:kind: stringrequired: falsedefault: []controlled: trueserializable: truesummary: Controlled selected option values. - name: default-valuestype:kind: arrayitem:kind: stringrequired: falsedefault: []serializable: truesummary: Initial uncontrolled selected option values. - name: optionstype:kind: arrayitem:kind: objectfields:value:kind: stringlabel:kind: stringdescription:kind: stringdisabled:kind: booleanrequired: falsedefault: []serializable: truesummary: Ordered selectable checkbox option items. - name: is-disabledtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Prevents changing selection and exposes disabled group semantics. - name: is-requiredtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Marks the group as requiring at least one selected option. - name: is-invalidtype:kind: booleanrequired: falsedefault: falsereflects: trueserializable: truesummary: Marks the selection as invalid and associates the error slot.slots: - name: labelrequired: truecardinality: exactly-oneaccepts: - textsummary: Visible group label and accessible-name source. - name: descriptionrequired: falsecardinality: zero-or-oneaccepts: - textsummary: Help text associated with the checkbox group. - name: errorrequired: falsecardinality: zero-or-oneaccepts: - textsummary: Validation error associated when is-invalid is true.events: - name: values-changepayload:values:kind: arrayitem:kind: stringaction:kind: action-refbubbles: truecomposed: truecancelable: falsesummary: Canonical values-change event carrying the full selected values array.states: - name: defaultsource: platformsummary: Enabled group with no invalid or disabled state. - name: checkedsource: propertysummary: State when one or more options matching values or default-values are selected. - name: focus-visiblesource: platformsummary: Keyboard-visible focus state on a checkbox option. - name: disabledsource: propertysummary: Disabled state derived from is-disabled or option disabled. - name: invalidsource: propertysummary: Invalid state derived from is-invalid. - name: requiredsource: propertysummary: Required state derived from is-required.parts: - name: rootsummary: Field container.slots: - label - description - error - name: labelsummary: Group label text.slots: - label - name: groupsummary: Native checkbox group container. - name: optionsummary: Option row label and control. - name: controlsummary: Native checkbox control. - name: option-labelsummary: Option label text. - name: option-descriptionsummary: Option description text. - name: descriptionsummary: Group description text.slots: - description - name: errorsummary: Group error text.slots: - errortokens:root:gap: spacing.xslabel:color: color.on-surfacetext: typography.label-mdrequired-indicator:color: color.errorgroup:gap: spacing.smoption:gap: spacing.smpadding-y: spacing.xscontrol:size: spacing.mdbackground: color.surfacebackground-checked: color.primaryforeground-checked: color.on-primaryborder-color: color.outlineborder-color-focus: color.primaryborder-color-disabled: color.disabledborder-width: 1pxradius: rounded.smdisabled-opacity: opacity.disabledoption-label:color: color.on-surfacetext: typography.body-mdoption-description:color: color.on-surface-varianttext: typography.body-mddescription:color: color.on-surface-varianttext: typography.body-mderror:color: color.errortext: typography.body-mdmessages: []obligations:accessibility:role: groupname: Label slot provides the accessible name.description: Description and error slots are programmatically associated with the group.keyboard: - Tab moves focus into and out of checkbox options in document order. - Space toggles the focused enabled checkbox option.semantics: - The group exposes required, invalid, and disabled state where the platform supports it. - Each option exposes checked and disabled state through native checkbox semantics. - Error text is associated only when invalid.behavior:model: inputinteractions: - Toggling an enabled option emits values-change with the full selected values array. - Disabled groups and disabled options do not change values. - Controlled values win over default-values.hostEffects: - Dispatch values-change event. - Bind values to SDUI form state when present.conditions: - rtl - reduced-motion - cvd-deuteranopia - density-compact - text-expansionsdui:status: serializableserializableProperties: - values - default-values - options - is-disabled - is-required - is-invalidserializableSlots: - label - description - erroreventBindings: - values-changenotes: Options serialize as ordered records; values-change serializes to a named binding/action channel.examples: - name: emptystate: defaultproperties:options: - value: emaillabel: Email - value: smslabel: SMS - value: phonelabel: Phoneslots:label: Notification channelsdescription: Choose every channel collaborators may use. - name: selectedstate: checkedproperties:default-values: - email - smsoptions: - value: emaillabel: Email - value: smslabel: SMS - value: phonelabel: Phoneslots:label: Notification channels - name: invalidstate: invalidproperties:is-invalid: trueis-required: trueoptions: - value: emaillabel: Email - value: smslabel: SMS - value: phonelabel: Phoneslots:label: Notification channelserror: Select at least one channel.
01
Examples
Generated from the contract's examples block.
Previews are the published @wyrd-company/react component, themed by the
brand's role tokens — flip the site's light/dark toggle and they follow.
emptystate: default
Notification channels
Choose every channel collaborators may use.
Usage
import { WyrdCheckboxGroup } from"@wyrd-company/react";
<WyrdCheckboxGroup options={[{"value":"email","label":"Email"},{"value":"sms","label":"SMS"},{"value":"phone","label":"Phone"}]} label="Notification channels" description="Choose every channel collaborators may use." />
// events: onValuesChange
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdCheckboxGroup(
options: [{"value":"email","label":"Email"},{"value":"sms","label":"SMS"},{"value":"phone","label":"Phone"}],
label: Text('Notification channels'),
description: Text('Choose every channel collaborators may use.'),
)
// events: onValuesChange
import { WyrdCheckboxGroup } from"@wyrd-company/react";
<WyrdCheckboxGroup isInvalid isRequired options={[{"value":"email","label":"Email"},{"value":"sms","label":"SMS"},{"value":"phone","label":"Phone"}]} label="Notification channels" error="Select at least one channel." />
// events: onValuesChange
import'package:wyrd_flutter/wyrd_flutter.dart';
WyrdCheckboxGroup(
isInvalid: true,
isRequired: true,
options: [{"value":"email","label":"Email"},{"value":"sms","label":"SMS"},{"value":"phone","label":"Phone"}],
label: Text('Notification channels'),
error: Text('Select at least one channel.'),
)
// events: onValuesChange
02
Properties
Name
Type
Default
Summary
values
array
Controlled selected option values.
default-values
array
Initial uncontrolled selected option values.
options
array
Ordered selectable checkbox option items.
is-disabled
boolean
false
Prevents changing selection and exposes disabled group semantics.
is-required
boolean
false
Marks the group as requiring at least one selected option.
is-invalid
boolean
false
Marks the selection as invalid and associates the error slot.
03
Slots & events
Slot
Cardinality
Accepts
Summary
label
exactly-one
text
Visible group label and accessible-name source.
description
zero-or-one
text
Help text associated with the checkbox group.
error
zero-or-one
text
Validation error associated when is-invalid is true.
Event
Payload
Summary
values-change
values, action
Canonical values-change event carrying the full selected values array.
04
Tokens
The contract's token bindings. Open the shared contextual sidebar from any example;
primary swatches reflect the color you pick there. Error swatches show the active
preset's values; editing any knob switches to custom and resets error to TWW · Ink.
Binding
Token
root.gap
spacing.xs
label.color
color.on-surface
label.text
typography.label-md
required-indicator.color
color.error
group.gap
spacing.sm
option.gap
spacing.sm
option.padding-y
spacing.xs
control.size
spacing.md
control.background
color.surface
control.background-checked
color.primary
control.foreground-checked
color.on-primary
control.border-color
color.outline
control.border-color-focus
color.primary
control.border-color-disabled
color.disabled
control.border-width
1px
control.radius
rounded.sm
control.disabled-opacity
opacity.disabled
option-label.color
color.on-surface
option-label.text
typography.body-md
option-description.color
color.on-surface-variant
option-description.text
typography.body-md
description.color
color.on-surface-variant
description.text
typography.body-md
error.color
color.error
error.text
typography.body-md
05
States
State
Source
Summary
default
platform
Enabled group with no invalid or disabled state.
checked
property
State when one or more options matching values or default-values are selected.
focus-visible
platform
Keyboard-visible focus state on a checkbox option.
disabled
property
Disabled state derived from is-disabled or option disabled.
invalid
property
Invalid state derived from is-invalid.
required
property
Required state derived from is-required.
06
Accessibility
From the contract's accessibility obligations. Role group; Label slot provides the accessible name.
Tab moves focus into and out of checkbox options in document order.
Space toggles the focused enabled checkbox option.
The group exposes required, invalid, and disabled state where the platform supports it.
Each option exposes checked and disabled state through native checkbox semantics.