Skip to content
Ink
Esc
↑↓navigate↵open⌘Jpreview
On this page

Confirmation

Confirm an action.

Example

import { Confirmation } from "ink";

<Confirmation title="Delete list"
  confirmLabel="Delete" onConfirm={deleteList}>
  Delete this list and all its items?
</Confirmation>

deleteList is your handler. Confirmation provides the whole screen, with one action at the bottom.

Delete list confirmation with small text and a bottom Delete action.

Pending

pending disables the action. Use pendingLabel to change its text.

<Confirmation title="Delete list"
  confirmLabel="Delete" onConfirm={deleteList}
  pending={deleting} pendingLabel="Deleting…">
  Delete this list and all its items?
</Confirmation>
A disabled Deleting action while deletion is pending.