Skip to main content

InputProps

Hierarchy

  • PromptProps<string>
    • InputProps

Index

Properties

optionaldefaultValue

defaultValue?: string

A default value. If none provided, will use an empty state.

optionalhideCursor

hideCursor?: boolean

Hide the cursor in the terminal. Will remove the background color, but still functions.

label

label: NonNullable<ReactNode>

Label to display before or above the prompt itself.

optionalmask

mask?: string

Mask to replace every inputted character with.

optionalonChange

onChange?: (value: string) => void

Callback triggered when the value changes.

onSubmit

onSubmit: (value: string) => void

Callback triggered when the value is submitted.

optionalplaceholder

placeholder?: string

Custom string to display when the value is empty and non-dirty.

optionalprefix

prefix?: string

Single character symbol to display before the label. Defaults to "?"".

optionalvalidate

validate?: (value: string) => void

Function to validate the value on submit. To trigger a failed state, thrown an Error.