const updatedSubscriptionPlan = await io.input.radio('Pick a new plan', [
{
value: 'iron',
label: 'Iron Plan',
},
{
value: 'gold',
label: 'Gold Plan',
disabled: true, // sold out
},
{
value: 'diamond',
label: 'Diamond Plan',
},
{
value: 'netherite',
label: 'Netherite Plan',
}
])
console.log(updatedSubscriptionPlan) // 'diamond'
The label to render above the input.
The label to render alongside the radio.
The value to return when checked.
The help to render below the radio label. Default undefined
.
Disables user input. Default false
.
Disables user input. Default false
.
The small help text to render below the label. Default undefined
.
The default selected radio item.
An asynchronous function that takes unknown
input and outputs either true
or an error message string
to show the user.