checkbox
Checkboxes on mobile app forms offer a straightforward way to make selections, especially for multiple options, enhancing usability and interaction.
The component is used in a jig.default inside of a form component and supports single- and multiple-selection options. The checkbox's initial checkbox status and required checkbox status can be set.

Configuration options
Some properties are common to all components, see Common component properties for a list and their configuration options.
instanceId
The unique identifier for the checkbox component.
label
Provide a label/name for the checkbox. 'Label' is displayed as a placeholder when no value is specified.
color
Sets the color of the checkbox based on conditions by using the when property. First evaluated to true will be used. Choose a color from the provided color palette. Default color is grey if the property is not specified in the YAML. See the list of available colors in .
errorText
Add text, string, or expressions to show text under the checkbox indicating an error/invalid value in the field. Text is shown in isNegative (red) styling.
helperText
Add text, string, or expressions to guide users by showing text under the checkbox. Helper text is displayed only when there is no errorText.
icon
Add an icon to the title. A list of icons is available. See for more information.
initialValue
The initialValue is the value that the checkbox will load with when the form is initially loaded. You can use this property to preset the checkbox value so that the user doesn't have to manually select it. Set to true loads the checkbox as selected, false loads the checkbox as unselected. Using the reset-state action with initialValues does not clear the checkbox, it resets the field back to its initialValue.
isAutoFocused
If true it will get focus immediately after the jig is displayed.
isHidden
If true the checkbox will be hidden on the form. If set to false the field will be shown.
isIgnored
When true, the field will be ignored when submitting the form and the content will not be stored.
isOptionalLabelHidden
If the field is optional you can turn off the "(optional)" label by setting this field to true. This property works in combination with isRequired: false.
isRequired
Set to true when the field is required. Useful when you use it in form submission. Set to false the checkbox is optional and will have an (optional) in the label.
nextProperty
Name of the property you want to focus next in the form when you use return/next on a keyboard.
style
The following property settings are available:
flex- Flex property if rendered inside row.isDanger- when the checkbox is selected the component displays in red.isDisabled- makes the checkbox field un-selectable.isPositive- when the checkbox is selected the component displays in green.isWarning- displays the component in red.
More than one can be true. It will be evaluated based on priority.
value
The value to show for the checkbox. Setting up a checkbox with a value property of true will display the checkbox as selected when the form loads, setting the property to false will display the checkbox as unselected when the form loads.
Actions
onChange
The action is triggered when the content in the checkbox is changed. Use IntelliSense (ctrl+space) to see the list of available actions.
onPress
OnPress action overwrites the main check / uncheck functionality.
Examples and code snippets
Checkbox on Form - Single Selection (Yes/No Question)

children:
- type: component.form
instanceId: agreement-form
options:
children:
- type: component.checkbox
instanceId: agreement
options:
label: I agree
isRequired: true
initialValue: truechildren:
- type: component.form
instanceId: agreement-form
options:
children:
- type: component.checkbox
instanceId: agreement
options:
label: [email protected][0].agreement
isRequired: true
initialValue: truedatasources:
checkbox-options:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- entity: default/checkbox
query: |
SELECT
id,
'$.order',
'$.day',
'$.agreement'
FROM [default/checkbox] ORDER by '$.order'Checkbox on Form - Multiple Selection

This example displays a question you can answer by selecting multiple checkboxes. The most common answers are already checked for better user experience, but the selection can always be changed.
Examples:
See the full example using static data in GitHub. See the full example using dynamic data in GitHub
children:
- type: component.form
instanceId: work-engagement-form
options:
children:
- type: component.checkbox
instanceId: sunday
options:
label: Sunday
isRequired: false
- type: component.checkbox
instanceId: monday
options:
label: Monday
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: tuesday
options:
label: Tuesday
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: wednesday
options:
label: Wednesday
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: thursday
options:
label: Thursday
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: friday
options:
label: Friday
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: saturday
options:
label: Saturday
isRequired: falsechildren:
- type: component.form
instanceId: work-engagement-form
options:
children:
- type: component.checkbox
instanceId: sunday
options:
label: [email protected][0].day
isRequired: false
- type: component.checkbox
instanceId: monday
options:
label: [email protected][1].day
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: tuesday
options:
label: [email protected][2].day
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: wednesday
options:
label: [email protected][3].day
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: thursday
options:
label: [email protected][4].day
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: friday
options:
label: [email protected][5].day
initialValue: true
isRequired: false
- type: component.checkbox
instanceId: saturday
options:
label: [email protected][6].day
isRequired: falsedatasources:
checkbox-options:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- entity: default/checkbox
query: |
SELECT
id,
'$.order',
'$.day',
'$.agreement'
FROM [default/checkbox] ORDER by '$.order'Last updated
Was this helpful?