Skip to main content

Check Box Element

The CheckboxElement class is utilised to create a single selection input element in a user interface.

Constructor

NameTypeDescription
elementIdstringUsed to set unique ID for the element
labelstringUsed to set a label for the element
optionsList<OptionElement>Used to set options for the element
optionalboolUsed to set optional flag for the element
defaultValueStringUsed to set default value for the element

Usage

Here's how to create an instance of the CheckboxElement class:

CheckBoxElement(
elementId: "service",
label: "Select Services",
defaultValue: ["pool"],//optional
options: [
OptionElement(label: "pool",value: "pool" ),
OptionElement(label: "gym",value: "gym" ),
OptionElement(label: "garden",value: "garden" ),
]
)

In this example, a new instance of CheckboxElement is created with an elementId "service", a label "Select Services", and a list of three options.