const updatedSubscriptionPlan = await io.input.select('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 checkbox.
The value to return when checked.
Disables user input. Default false.
Disables user input. Default false.
The small help text to render below the label. Default undefined.
The default selected option.
An asynchronous function that takes unknown input and outputs either true or an error message string to show the user.