Confirm dialogs
Ask before something cannot be undone — and ask in words that say what will happen, not “Are you sure?”. One dialog is shared by the whole page and answered with a promise.
Destructive
the red one — and focus never lands on it
A caution
not destructive, but worth stopping for
A plain question
when nothing is at stake
A dialog of its own
when a page needs a question the shared one cannot ask
Export the September ledger?
Every posting for the month and the balance after each, as one CSV file. Nothing in the books changes.
How it is called
if (await $store.confirm.ask({
title: 'Void INV-0241?',
body: 'It keeps its number and stays in the ledger at zero.',
yes: 'Void it',
tone: 'neg'
})) {
// they said yes
}
- The title asks the question and names the thing — “Void INV-0241?”, not “Are you sure?”.
- The body says what will happen, including what will not be undone.
- The button repeats the verb. “Void it” is unmistakable where “OK” is not.
- Focus starts on Cancel. Someone hitting Enter out of habit must not destroy anything.
- Escape and the backdrop both mean no.