1. Fields
  2. Radio Field

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.

loading...

Result

The field will be displayed as radio options in the form, as below: Preview of a radio field in a form

The resultant data will be available in the stubpost.data as:

loading...

This can be substituted with eg. ~~stubpost.data.favourite_color where required.

Parameters

params.options
required
array

An array of objects that define the choices that the user can select from. Each object should have a label and a value.

params.options.*.label
required
string

The text that will be displayed to the user.

params.options.*.value
required
string

The value that can be used in the action's logic.

See fields for common field parameters like validation and conditional rendering.