Skip to main content
io.select.single() asks to pick one option from a drop-down and returns its value. Provided by the @awaitio/select-single package.
A Single choice drop-down with Slack chosen, with help text under it

Install

Setup

Register it under the key you want in io, see Input components:
app.ts

Usage

Props

Optional

The field is required. Chain .optional() to let it stay empty; the handler then gets string | undefined, see Optional fields.

Returns

string: the chosen option’s value.

Built-in validation

The server checks every answer, so a crafted request cannot slip in another value:

Custom validation

Chain .validate() for a check of your own. It runs on the server after the checks above, gets the value the handler would get and returns a message to show under the field, or nothing when the value is fine; see Custom validation.