Components
Confirm
Yes/no confirmation prompt. The most common CLI interaction pattern.
A y/N confirmation prompt using Ink's useInput. Shows a blinking cursor while waiting. Resolves with a static confirmation line after the user answers.
Installation
Usage
Examples
Destructive confirmation (default No)
Safe action (default Yes)
Key bindings
| Key | Action |
|---|---|
y / Y | Confirm |
n / N / Esc | Cancel |
Enter | Use defaultValue |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
message | string | — | Question to display (required) |
defaultValue | boolean | false | true = Y default, false = N default |
onConfirm | () => void | — | Called on confirmation (required) |
onCancel | () => void | undefined | Called on cancellation |
theme | InkUITheme | darkTheme | Color theme |