Skip to main content

Checkbox

The Checkbox component can be used in any form to provide a set of checkboxes.

Schema

[
{
"name": "select-frameworks",
"meta": {
"displayName": "Select Frameworks",
"displayType": "checkbox",
"config": { "multiple": true },
"readOnly": false,
"className": "test",
"isDisabled": false,
"value": ["react"],
"options": [
{
"label": "React",
"value": "react"
},
{
"label": "Vue",
"value": "vue"
},
{
"label": "Svelte",
"value": "svelte"
}
],
"htmlProps": {
"disabled": true,
"allowDynamic": true
},
"validation": {
"required": true
}
}
}
]

Example


Form Data:
{}

Field Properties

Properties used by this field (inside meta field in schema)

NameDescriptionType
nameThe unique identifier for the checkbox control instance.string
displayNameA string that sets the display name of the checkbox control.string
displayTypeA string indicating the type of control, which is "checkbox" in this case.string
descriptionA string providing additional information or instructions about the checkbox control.string
valueThe initial value of the selected checkboxes.array
optionsAn array of objects representing the checkbox options. Each object should contain:array of objects
labelThe display label for the checkbox (within options).string
valueThe value of the checkbox (within options).any
validationAn object for validation rules.object
requiredA boolean indicating if the checkbox control is required (within validation).boolean
readOnlyA readonly field is not editable and value cannot be changedboolean
configAn object that configures advanced properties.object

config` Object

NameDescriptionType
multipleAllow users to select multiple optionsboolean
value set to first option
[
{
"name": "select-frameworks",
"meta": {
"displayName": "Select your libraries",
"displayType": "checkbox",
"description": "A normal description for the group",
"value": ["react"],
"options": [
{
"label": "React",
"value": "react"
},
{
"label": "Vue",
"value": "vue"
},
{
"label": "Svelte",
"value": "svelte"
}
],
"validation": {
"required": true
}
}
}
]
required set to false
[
{
"name": "select-frameworks",
"meta": {
"displayName": "Select your libraries",
"displayType": "checkbox",
"description": "A normal description for the group",
"options": [
{
"label": "React",
"value": "react"
},
{
"label": "Vue",
"value": "vue"
},
{
"label": "Svelte",
"value": "svelte"
}
],
"validation": {
"required": false
}
}
}
]
single checkbox
[
{
"name": "accept-terms",
"meta": {
"displayName": "Accept Terms and Conditions",
"displayType": "checkbox",
"description": "Please accept the terms and conditions to proceed.",
"value": false,
"options": [
{
"label": "I agree",
"value": true
}
],
"validation": {
"required": true
}
}
}
]