Fields
Radio Field
The Radio Field is an input field that allows for selecting one option from a predefined set of choices.
Basic usage
Adds a radio
field to the fields of an action.
The options
parameter can be used to define the choices that the user can select from. Each option should have a label
and a value
. The label
is the text that will be displayed to the user, and the value
is the value that can be used in the action logic.
Result
The field will be displayed as radio options in the form, as below:
The resultant data will be available in the stubpost.data
as:
This can be substituted with eg. ~~stubpost.data.favourite_color
where required.
Parameters
required array
params.options An array of objects that define the choices that the user can select from. Each object should have a label
and a value
.
required string
params.options.*.label The text that will be displayed to the user.
required string
params.options.*.value The value that can be used in the action's logic.
See fields for common field parameters like validation and conditional rendering.