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
| Property | Type | Restrictions | Description |
|---|---|---|---|
| options | ValueOptions | Required | The options users can select from. |
| defaultValue | string | - | 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.