Skip to main content

Radio Button Element

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

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

Class Usage

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

RadioButtonElement(
elementId: "gender",
label: "Gender",
options: [
OptionElement(label: "Male",value: "Male" ),
OptionElement(label: "Female",value: "Female" ),
]
)