ORIZEN/TUI
ComponentsConfirmInput

ConfirmInput

stable

Inline y/n confirmation prompt with configurable default answer.

Browser preview is a simulation. The copied component runs in actual terminal apps.

confirm-input.tsx
Overwrite existing file?[Y/n]
Delete 3 files?[y/N]

Installation

npx orizen-tui@latest add confirm-input

if dependency install fails, run: npm install ink@^5.0.1 react@^18.3.1 @types/react@^18.3.18 orizen-tui-core@latest

Usage

confirm-input.imports.tsx
confirm-input.example.tsx

Examples

Usage

confirm-input.example1.tsx
Overwrite existing file?[Y/n]
Delete 3 files?[y/N]

API Reference

ConfirmInput

message-
string

Question shown to the user

defaultAnswer'yes'
'yes' | 'no'

Pre-selected answer (shown capitalized)

onConfirm-
(answer: boolean) => void

Called when user confirms (optional)

focustrue
boolean

Whether input accepts keyboard events