Components

Number

Usage

const newSeatCount = await io.input.number('New seat count')
console.log(newSeatCount) // 5

Parameters

labelrequired
string

The label to render above the input.

options { ... }
defaultValue
number

Default value rendered in input. Default 0.

step
number

Default value rendered in input. Default 1.

min
number | undefined

Default value rendered in input. Default undefined.

max
number | undefined

Default value rendered in input. Default undefined.

disabled
boolean

Disables user input. Default false.

help
string

The small help text to render below the input. Default undefined.

placeholder
string

The placeholder to render within the input. Default undefined.

customValidator
(input: unknown) => Promise<string | true>

An asynchronous function that takes unknown input and outputs either true or an error message string to show the user.