Radio
A radio button allowing the user to select one of multiple data option for small datasets.
Configurable properties
- Field label: Label displayed above the radio component. Can either be an expression, plain text, or templating syntax.
- Field description: Description provided below the radio component. Can either be an expression, plain text, or templating syntax.
- Key: Binds the radio component to a form variable, refer to data binding docs.
- Default value: Provides a default selection in case no input data exists for the given key. Only available for static options sources.
- Read only: Makes the radio read-only, meaning the user can't change but only read its state. Can be dynamically set using an expression.
- Disabled: Disables the radio component, for use during development.
- Options source: Radio components can be configured with an options source defining the individual choices the component provides, refer to options source docs.
- Hide if: Expression to hide the radio.
- Columns: Space the field will use inside its row. Auto means it will automatically adjust to available space in the row. Read more about the underlying grid layout in the Carbon Grid documentation.
- Validation: Given that one of the following properties is set, the form will only submit when the respective condition is fulfilled. Otherwise, a validation error will be displayed.
- Required: One radio option must be selected.
Datatypes
Radio components can be bound to any
data, but we recommend working with strings
. The component will correlate the data value with the appropriate option defined in the options source. If no option is found, the data will simply be ignored.