Checkbox Group Component

1. Overview

The CHECKBOX_GROUP component provides multiple checkboxes from which users can select any combination of options.

🛝 Use the Dynamic Form Playground to see the Checkbox Group component in action and try out different configurations

2. Key Features

  • Multiple selection via a group of checkboxes
  • Support for small or large label sizes
  • Translation and string interpolation support
  • Validation support for requiring at least one selection
  • Horizontal or vertical layout options

3. Configuration Properties

Base Properties

PropertyTypeRequiredDescription
type'CHECKBOX_GROUP'YesSpecifies the field type as CHECKBOX_GROUP.
idstringYesUnique identifier for the field. The field's value is stored in the form state under this key.
renderNamestringNoOptional name added as data-render-name attribute to locate the rendered element in the DOM.
labelstringYesLabel text displayed above the checkbox group. Supports translation and string interpolation.
valuestring[]NoThe initially selected option values. Each entry must match the stringified value of one of the configured options.
hintstringNoAdditional hint text displayed below the label.
notestringNoInformational note displayed when there are no errors.
infoIconDfInfoIconConfigNoInfo icon with popover. Object with popoverText (string, required) and popoverDirection ('top', 'bottom', 'left', 'right').
validatorsarrayNoValidation rules for the field. Common type: REQUIRED (validates that at least one option is selected). Each validator has type and optional errorMessage.
testIdstringNoTest identifier for automated testing. Set as data-testid attribute.
aclarrayNoAccess control rules for field visibility/editability. Each rule has state ('hidden', 'readonly', 'disabled', 'visible', 'editable') and optional condition (Filtrex expression).
spacingstringNoMargin spacing before next field: 'NONE' (0px), 'XS' (8px), 'S' (16px), 'M' (24px), 'L' (32px), 'XL' (40px), 'XXL' (48px).

Note: This component does not support the columnSpan property, meaning that the component always spans the full width of the form (12 columns). Use layout.optionsColumnSpan to control the size of each option within the group instead.

Component Specific Properties

PropertyTypeRequiredDescription
optionsDfOptions[] | stringYesThe options for the checkbox group. Can be either:
1. A hardcoded array of objects for direct display. Each object must have a 'label' and 'value'.
2. A string expression used by an option provider service to dynamically fetch options.
See also DfOptions
labelSizeSmallbooleanNoSets the checkbox label size to 'small'. The default size is 'large'.
layoutHorizontalLayout | VerticalLayoutNoThe layout configuration for the checkbox group.
See also HorizontalLayout, VerticalLayout

Options Properties (DfOptions)

PropertyTypeRequiredDescription
labelstringYesThe label to display for the list
valuestring | number | booleanYesThe value of the option
testIdstringNoThe test id of the option used for automated tools, like cypress to find the component
and made independent of other config changes.
If implemented, the value should be the following data-testid=VALUE_HERE
with the testid in lowercase.

Layout Configuration (HorizontalLayout)

PropertyTypeRequiredDescription
horizontalbooleanYesOption to enable horizontal layout via configuration
optionsColumnSpannumberNoThis size of each option.
By default, each option takes 4 columns but you have an option to configure it to 3, 6 or 12 columns.
For the best user experience, a 3-column span should be used only in expert journeys when fullWidthFormInExpert is set to true.
For horizontal groups, a maximum of 3 options per row is allowed in retail journeys and expert journeys with half-width forms to maintain readability and spacing consistency.
For expert journeys with full-width forms, horizontal groups can have up to 4 options per row.

Layout Configuration (VerticalLayout)

PropertyTypeRequiredDescription
groupLabelLeftAlignInRetailbooleanNoOption to left-align the group label in retail journeys.
This option is applicable to vertical layouts only.
The left-align label uses the same column span as the options. For long labels, it's recommended to set optionsColumnSpan to 6 or 12.
horizontalbooleanNoOption to enable horizontal layout via configuration
optionsColumnSpannumberNoThis size of each option.
By default, each option takes 4 columns but you have an option to configure it to 3, 6 or 12 columns.
For the best user experience, a 3-column span should be used only in expert journeys when fullWidthFormInExpert is set to true.
For horizontal groups, a maximum of 3 options per row is allowed in retail journeys and expert journeys with half-width forms to maintain readability and spacing consistency.
For expert journeys with full-width forms, horizontal groups can have up to 4 options per row.

4. Configuration Examples

Basic Checkbox Group

Example :
{
  "id": "coverageOptions",
  "type": "CHECKBOX_GROUP",
  "label": "Select coverage options",
  "options": [
    { "label": "Liability", "value": "liability" },
    { "label": "Comprehensive", "value": "comprehensive" },
    { "label": "Collision", "value": "collision" }
  ]
}

Checkbox Group with Horizontal Layout

Example :
{
  "id": "notifications",
  "type": "CHECKBOX_GROUP",
  "label": "Notification preferences",
  "layout": { "horizontal": true },
  "options": [
    { "label": "Email", "value": "email" },
    { "label": "SMS", "value": "sms" },
    { "label": "Push", "value": "push" }
  ]
}

Checkbox Group with Dynamic Options

Example :
{
  "id": "selectedAddOns",
  "type": "CHECKBOX_GROUP",
  "label": "Select add-ons",
  "options": "$.availableAddOns"
}

Checkbox Group with Validation

Example :
{
  "id": "agreedPolicies",
  "type": "CHECKBOX_GROUP",
  "label": "You must agree to at least one policy",
  "options": [
    { "label": "Privacy Policy", "value": "privacy" },
    { "label": "Terms of Service", "value": "terms" }
  ],
  "validators": [{ "type": "REQUIRED", "errorMessage": "Please select at least one option" }]
}

5. API Reference

For complete API documentation, see DfCheckboxGroupConfig.

For Aquila component documentation and design guidelines, see Checkbox - Aquila Design System.

results matching ""

    No results matching ""