Radio
The Radio component can be used in any form to provide a set of radio buttons.
Examples
A simple radio button group with horizontal layout
Form Data:
{}
Field Properties
Properties used by this field (inside meta field in schema)
Name | Description | Type |
---|---|---|
name | The unique identifier for the radio control instance. | string |
displayName | A string that sets the display name of the radio control. | string |
displayType | A string indicating the type of control, which is "radio" in this case. | string |
description | A string providing additional information or instructions about the radio control. | string |
value | The initial value of the selected radio button. | any |
options | An array of objects representing the radio options. Each object should contain: | object[] |
label | The display label for the radio button (within options). | string |
value | The value of the radio button (within options). | any |
validation | An object for validation rules. | object |
required | A boolean indicating if the radio control is required (within validation). | boolean |
htmlProps | The htmlProps object to set properties for the underlying HTML radio control. | object |
readOnly | A readonly field is not editable and value cannot be changed | boolean |
HTML Props Properties
In addition to the basic properties, htmlProps
allows further customization of the radio buttons' layout and label placement.
Options Layout
The optionsLayout
property defines how the radio buttons are laid out. It accepts the following values:
Value | Description |
---|---|
row | Aligns the radio buttons horizontally |
column | Aligns the radio buttons vertically (default) |
Label Placement
The labelPlacement
property controls where the label is positioned relative to the radio button. It accepts the following values:
Value | Description |
---|---|
end | Places the label to the right of the control (default) |
start | Places the label to the left of the control |
top | Places the label above the control |
bottom | Places the label below the control |
Allow Dynamic
The allowDynamic
property allows for static and dynamic value selection