Skip to content

ConfirmDialog

Yes-or-no gate before a destructive action. Confirm dispatches an event and closes; your script does the rest.

Example

<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

PropTypeDefaultDescription
title / bodystring-Heading and explanation.
confirmLabel / cancelLabelstringConfirm / CancelButton labels.
dangerbooleanfalseDanger-styled confirm button.

Accessibility