Prompts & Inputs
$
Confirm
FREEYes/no confirmation prompt with keyboard toggle. Supports arrows, y/n keys, Tab, and vim bindings.
interactiveyes/nokeyboard
# Preview
BOOTING PREVIEW
# Usage
import { confirm } from '@taracod/termui';
const ok = await confirm({
message: 'Delete all files?',
defaultValue: false,
});
if (ok) {
console.log('Deleted!');
} else {
console.log('Cancelled.');
}# API
| Prop | Type | Default | Description |
|---|---|---|---|
| message | string | required | Prompt text |
| defaultValue | boolean | false | Initial selected value |
| yesLabel | string | Yes | Label for true option |
| noLabel | string | No | Label for false option |