ConfirmDialog
Yes-or-no gate before a destructive action. Confirm dispatches an event and closes; your script does the rest.
Example
Delete this project?
This removes the project and every deployment in it. This cannot be undone.
<Button variant="danger" data-ink-dialog="#confirm-demo">Delete project</Button>
<ConfirmDialog
id="confirm-demo"
title="Delete this project?"
body="This removes the project and every deployment in it."
confirmLabel="Delete"
danger
/>Wiring confirm
document.addEventListener("ink:confirm", (event) => {
console.log("confirmed: " + event.detail.id);
// ...perform the destructive action
});Props
| Prop | Type | Default | Description |
|---|---|---|---|
title / body | string | - | Heading and explanation. |
confirmLabel / cancelLabel | string | Confirm / Cancel | Button labels. |
danger | boolean | false | Danger-styled confirm button. |
Accessibility
- Same contract as Dialog: trap, Escape, backdrop, focus restore.
- State the consequence in
body, not just the question.