Skip to main content

Radio Field

type: "radio"

Radio buttons of predefined options. Works like a select field, but shows all options at once, which suits a small number of options.

Additional Properties

PropertyTypeRestrictionsDescription
optionsValueOptionsRequiredThe options users can select from.
defaultValuestring-The value of the option selected by default.

Example

mobro-widget-config.json
{
"config": [
{
"name": "direction",
"label": "Direction",
"type": "radio",
"defaultValue": "horizontal",
"options": [
{"label": "Horizontal", "value": "horizontal"},
{"label": "Vertical", "value": "vertical"}
]
}
]
}

Usage

The value of a radio field is the value of the selected option, just like for a select field. To read it in a widget, use useSelectField.