Checkbox Component

1. Overview

The CHECKBOX component provides a single checkbox for boolean selections, such as accepting terms and conditions or toggling preferences.

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

2. Key Features

  • Single boolean selection with configurable label
  • Support for small or large label sizes
  • Translation and string interpolation support
  • Validation support for required checkbox

3. Configuration Properties

Base Properties

PropertyTypeRequiredDescription
type'CHECKBOX'YesSpecifies the field type as CHECKBOX.
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 next to the checkbox. Supports translation and string interpolation.
valuebooleanNoThe field's initial value. If set, the checkbox will be pre-checked/unchecked based on this value.
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_TRUE (validates that checkbox is checked). 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).
columnSpannumberNoNumber of columns to span (1-12) in CUSTOM_COLUMN layout. Default: 12 (full width). See Overriding the number of grid columns when using --df-custom-columns.
spacingstringNoMargin spacing before next field: 'NONE' (0px), 'XS' (8px), 'S' (16px), 'M' (24px), 'L' (32px), 'XL' (40px), 'XXL' (48px).

Component Specific Properties

PropertyTypeRequiredDescription
labelSizeSmallbooleanNoSets the checkbox label size to 'small'. The default size is 'large'.

4. Configuration Examples

Important: For checkboxes that must be checked (like terms acceptance), use REQUIRED_TRUE validator to ensure the checkbox is actually checked.

Single Checkbox

Example :
{
  "id": "termsAccepted",
  "type": "CHECKBOX",
  "label": "I accept the terms and conditions",
  "validators": [
    {
      "type": "REQUIRED_TRUE",
      "errorMessage": "You must accept the terms and conditions"
    }
  ]
}

Checkbox with Small Label

Example :
{
  "id": "newsletter",
  "type": "CHECKBOX",
  "label": "Subscribe to newsletter",
  "labelSizeSmall": true
}

Checkbox with Hint

Example :
{
  "id": "marketingConsent",
  "type": "CHECKBOX",
  "label": "I agree to receive marketing communications",
  "hint": "You can unsubscribe at any time"
}

Checkbox with Note

Example :
{
  "id": "dataProcessing",
  "type": "CHECKBOX",
  "label": "I consent to data processing",
  "note": "This information is used solely for account verification purposes"
}

Checkbox with Info Icon

Example :
{
  "id": "advancedMode",
  "type": "CHECKBOX",
  "label": "Enable advanced mode",
  "infoIcon": {
    "popoverText": "Advanced mode enables additional features"
  }
}

Checkbox with Access Control

Example :
{
  "id": "adminOption",
  "type": "CHECKBOX",
  "label": "Admin only option",
  "acl": [
    {
      "state": "disabled"
    }
  ]
}

5. API Reference

For complete API documentation, see DfCheckboxConfig.

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

results matching ""

    No results matching ""