Skip to main content
io.input.boolean() asks a yes or no question and returns true or false. Provided by the @awaitio/input-boolean package.
The label Send a confirmation email above a checked checkbox with the help text to its right

Install

Setup

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

Usage

Props

Returns

boolean: true when the box is checked, false when it is not.

Built-in validation

Nothing is checked: an unchecked box gives false.

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.