Multiple independent checkbox choices sharing native form values, validation and cleanup with QDS inline choices.
<form>
<fieldset><legend>Report review</legend>
<qds-checkbox-group id="reviewers" name="reviewers" label="Notify reviewers" required hint="Choose one or more internal teams."></qds-checkbox-group>
</fieldset>
</form>
<script type="module">
import '/assets/components/checkbox-group/qds-checkbox-group.js';
reviewers.options = [{value: 'operations', label: 'Operations team'}, {value: 'management', label: 'Asset management'}];
reviewers.defaultValues = ['operations'];
</script>
options: cloned {value, label, disabled?, description?}[]; nonempty unique string identities. Descriptions remain visible text.values: current string array in option order. Disabled/unavailable options are excluded. Assignments are silent; pending identities can become available after options load.defaultValues: reset values. Scalar inherited value reads/sets the first selection; use arrays for this group. multiple is read-only and always true.name, form: repeated native FormData entries and external form association. Native fieldset disabling and reset are supported. No name/disabled/empty selection contributes no values.label, aria-label, aria-labelledby, hint: group naming and instructions.required: at least one available enabled option. invalid, errorText / error-text, setCustomValidity(message), checkValidity(), reportValidity() support author and constraint errors.disabled, readonly, size (sm/md/lg), validateOn / validate-on (blur/input/submit). Readonly choices retain focus without accepting changes.focus(options?): focus the first available checkbox. Parts: label, options, option, hint, error.input / change: bubbling/composed {component, value, values, multiple: true} for user changes. qds-validity-change: {component, valid, validity, message}. Programmatic value writes emit no input/change.Use native fieldset and legend around related fields, including multiple QDS controls. Keeping the fieldset in the same light-DOM form tree preserves native form ownership and disabled behavior; no framework runtime or custom fieldset is required. Style the recipe with existing QDS surface, text and border tokens. Do not replace individual field labels with a legend.
Each named group contains separately tabbable checkbox buttons with checked/readonly/disabled states, visible checked marks and at least 44px targets. Space toggles; native button Enter activation also works. Required-group instructions describe choosing at least one, rather than incorrectly marking every checkbox individually required. Feedback is associated with the group and choices. There is no mixed/select-all parent; compose a clearly labelled application action when needed.
Guidance: W3C grouping controls, APG checkbox.
The generated string-array forms adapter drives internal reviewer selection in Operations > New update (/#/operations/updates/new). The report requires an internal reviewer, displays selected teams on review and disables reporting fieldsets after a local submission. No notification or persistent write occurs; navigation/reload resets this state. See adjacent test.html for values/reset, external labels, required/custom errors, readonly/disabled and native fieldset examples.
checkValidity() checks constraints without moving focus. Native invalid submission, form.reportValidity() and the component’s reportValidity() reveal the error and focus the first available checkbox. Repeated validation preserves visible option labels, selection and normal Tab order. Canceling the native invalid event suppresses the browser’s default validation focus; the validity result remains false. Reset restores the documented defaults.