Skip to main content

Radio Buttons

List of buttons that allows the user to select one option from a list of options.

Schema

[
{
"name": "connection_method",
"meta": {
"displayName": "Connection Method",
"displayType": "radiobutton",
"value": "host",
"readOnly": false,
"htmlProps": {
"optionsLayout": "row",
"labelPlacement": "end", // postion of label for radio button
"allowDynamic": true
},
"validation": {
"required": true
},
"options": [
{
"value": "host",
"label": "Host"
},
{
"value": "uri",
"label": "Connection URI"
}
]
}
}
]

Example


Form Data:
{}

props

name

This field should be a unique string.

meta object

The meta object contains properties that define the display characteristics and behavior of the section.

FieldData TypeDescription
classNameCustom CSS class for the radio control containerstring (default: "ripple-radio-buttons-container")
displayNameStringIt is used to display the name of the field in the form
displayTypeStringIt is used to determine the field type to be displayed. Supported options:
displayPropsObjectIt is used for field layouting. Refer for details: DisplayType
htmlPropsObjectIt is used for setting native html attributes to basic form controls like text_field, select, number, password, email etc. Example of such attributes would be like step, min, max for displayType number
valueString / Boolean / NumberNone
validationObjectFor field validation
dependenciesObjectDefines relationships and dependencies between various fields. Refer here for details: Dependencies
isDisabledWhether the field is disabledboolean
descriptionA description text to display under the buttonsstring
readOnlyA readonly field is not editable and value cannot be changedboolean

Common Validation Properties

FieldDescription
requiredMarks a field as mandatory
patternAdds a pattern validation for the field. For email, pattern is supported by default
patternDetailContains info msg and error msg for pattern validation property
minFor Textbox fields, it is the minimum number of characters required for the field. For number fields, it is the minimum value allowed
maxFor Textbox fields, it is the maximum number of characters allowed. For number fields, it is the maximum value allowed
minDetailContains error and info msg for min validation property
requiredDetailContains info msgs about the required validation property

Example JSON

RadioButton with options

[
{
"name": "connection_method",
"meta": {
"displayName": "Connection Method",
"displayType": "radiobutton",
"value": "host",
"htmlProps": {
"optionsLayout": "row",
"labelPlacement": "end"
},
"validation": {
"required": true
},
"options": [
{
"value": "host",
"label": "Host"
},
{
"value": "uri",
"label": "Connection URI"
}
]
}
}
]

RadioButton with default value

[
{
"name": "connection_method",
"meta": {
"displayName": "Connection Method",
"displayType": "radiobutton",
"value": "host",
"htmlProps": {
"optionsLayout": "row",
"labelPlacement": "end"
},
"validation": {
"required": true
},
"options": [
{
"value": "host",
"label": "Host"
},
{
"value": "uri",
"label": "Connection URI"
}
]
}
}
]

RadioButton with description

[
{
"name": "connection_method",
"meta": {
"displayName": "Connection Method",
"displayType": "radiobutton",
"value": "host",
"htmlProps": {
"optionsLayout": "row",
"labelPlacement": "end"
},
"validation": {
"required": true
},
"description": "Select the connection method",
"options": [
{
"value": "host",
"label": "Host"
},
{
"value": "uri",
"label": "Connection URI"
}
]
}
}
]