Checkbox Group
This page provides instructions on using the Checkbox Group widget to allow users to select multiple items from a predefined set of choices.
Content properties
These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.
Data
Options String
This property allows you to set the labels and values for the items. You can add these labels and values directly from the user interface or use JavaScript by providing options in JSON format, like:
[
{
"label": "Option1",
"value": "OPTION1"
},
{
"label": "Option2",
"value": "OPTION2"
}..
]
Ensure that the values assigned to each option are unique. Additionally, you can dynamically display data by using JavaScript. For instance, you can use the .map()
function to transform the data to the desired format, like:
{{getdata.data.map( p => ({label: p.country, value: p.country}))}}
Default Selected Values String
Allows you to set default options in a widget. These options are initially selected when the widget is loaded, representing the user's default input unless modified. Multiple default items can be added by providing them as an array of values. For example:
[
"OPTION1", "OPTION2"
]
Label
The Label property is a group of customizable settings that define the main text displayed on the widget.
Text String
Sets the label of the Checkbox.
Position String
This property allows you to configure the label's placement in three ways:
- Auto: Automatically positions the label based on the widget type and layout.
- Left: Aligns the label to the left side of the widget.
- Alignment: You can also control the text's placement relative to the Checkbox Group. You have the choice to align it either to the Left boundary or closer to the Checkbox Group using the Right alignment option.
- Width: This allows you to control the proximity of the text to the Checkbox Group, determining how close or far it can be positioned.
- Top: Positions the label above the widget.
Validations
Required Boolean
This validation feature allows you to designate the Checkbox Group as a mandatory field. For instance, when the Checkbox is placed within a Form widget, enabling the Required property ensures that the Form's submit button remains disabled until the Checkbox Group is checked.
General
General properties are essential configurations that provide overall control over the widget's behavior and appearance.
Tooltip String
This feature enables you to add hints or provide additional information to guide the user regarding the required input.