Radio Group
Use radio buttons when you want the user to choose a single option from a set.
Schema
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "Radio Group Control",
"description": "A set of radio buttons from which the user can select one option.",
"type": "object",
"required": [
"radioButtons",
"control",
"label"
"value"
],
"properties": {
"control": {
"const": "radio-group"
},
"label": {
"title": "Label",
"description": "Radio group label",
"type": "string"
},
"value": {
"title": "Value",
"description": "Radio group value",
"type": "string"
},
"radioButtons": {
"title": "Radio Buttons",
"description": "List of radio buttons",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"label",
"value"
],
"properties": {
"label": {
"title": "Label",
"description": "Radio label",
"type": "string"
},
"value": {
"title": "Value",
"description": "Radio value",
"type": "string"
}
}
}
}
}
}
Example
{
"option": "radio-group",
"label": "Direction",
"value": {
"$ref": "#/schema/direction"
},
"items": [
{
"label": "North",
"value": "north"
},
{
"label": "South",
"value": "south"
},
{
"label": "East",
"value": "east"
},
{
"label": "West",
"value": "west"
}
]
}