Skip to main content

Select Field

type: "select"

A select of predefined options. For a small number of options, consider a radio field instead.

Additional Properties​

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

Options can show an icon next to their label, e.g. "icon": "md/MdHome". The icon of the selected option is shown in the select as well.

To let users pick several options, use a multi-select field. For a few short options, a button group takes less room.

Example​

mobro-widget-config.json
{
"config": [
{
"name": "time_format",
"label": "Time format",
"type": "select",
"defaultValue": "24h",
"options": [
{"label": "12h", "value": "12h"},
{"label": "24h", "value": "24h"}
]
}
]
}

Usage​

To read the value of this field in a widget, use useSelectField.