These attributes allow you to customize or extend the component’s behaviour and presentation.
legend
The legend attribute defines the legend for a group of checkboxes.
<gcds-checkboxeslegend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
name
The name attribute identifies the checkboxes component within a form. It is used to reference the component after a form is submitted.
<gcds-checkboxeslegend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
options
The options attribute defines the checkboxes to render by taking an array of objects, one per checkbox.
<gcds-checkboxeslegend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
Optional attributes
These attributes allow you to customize or extend the component’s behaviour and presentation.
autofocus
The autofocus attribute controls whether the first checkbox will be focused automatically when the page loads. By default, it is set to false. When set to true, the checkbox is focused on render.
<gcds-checkboxesautofocuslegend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
disabled
The disabled attribute controls whether the checkboxes are disabled or not. By default, it is set to false.
<gcds-checkboxesdisabled legend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
error-message
The error-message attribute defines the error message to display for invalid checkboxes.
<gcds-checkboxeserror-message="Error message"legend="Legend" name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
form
The form attribute specifies the ID of the form that the checkboxes belong to.
<gcds-checkboxesform="form-id"legend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
hide-label
The hide-label attribute controls whether the label is hidden or not.
The hide-legend attribute controls whether the legend is hidden or not.
<gcds-checkboxeshide-legend legend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
hint
The hint attribute defines the hint text displayed under the label or legend.
<gcds-checkboxeshint="Hint / Example message."legend="Legend" name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
required
The required attribute controls whether the checkbox fieldset is required or not. When set to true, it adds “required” after the label or legend, and activates the required validator.
<gcds-checkboxesrequired legend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
validate-on
The validate-on attribute defines the validation event for the checkboxes.
<gcds-checkboxesvalidate-on="other"required legend="Legend"name="checkexample"options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"}]'></gcds-checkboxes>
value
The value attribute contains an array of the values of all currently checked checkboxes. It updates as selections change.
<gcds-checkboxes value='["check2"]' legend="Legend" name="checkexample" options='[ {"id": "form-check-1", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check1"}, {"id": "form-check-2", "label": "Label", "hint": "Description or example to make the option clearer.", "value": "check2"} ]'></gcds-checkboxes>
Code builder Generate an instance of the component you need by selecting its code properties.
Explore by choosing different code values to generate the instance you want.
Get the code and pull it into your environment.
Add any copy you need to the component (like text for a label).
Note: The code builder uses English for all code elements, which follows standard practice. Help us improve Have questions or a request? Give feedback on our contact form. Something's wrong? Raise it through GitHub with an account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others. Give feedback Report an issue on GitHub 2026-06-10