Confirm Dialog
Asks to confirm or cancel an action.
MarkdownExamples
Destructive
Async action
With keep-open, Confirm doesn't close the dialog. Set loading while your action runs, then close it yourself; it can't be cancelled while loading.
API
| Prop | Type | Default |
|---|---|---|
titleHeading, which names the dialog. | string | — |
descriptionSupporting text, announced as the dialog's description. | string | — |
confirmTextConfirm button text. Defaults to the | string | — |
cancelTextCancel button text. Defaults to the | string | — |
dangerDestructive action: a danger-styled confirm, and Cancel takes initial focus. | boolean | false |
loadingThe confirmed action is running: Confirm shows it, and the dialog can't be cancelled. | boolean | false |
keepOpenStay open after Confirm, e.g. while | boolean | false |
openWhether the dialog is open. | boolean | false |
| Event | Payload |
|---|---|
cancelCancelled by the button or Escape. | [] |
confirmThe confirm button was pressed. | [] |
update:open
| [value: boolean] |
| Slot | Props |
|---|---|
defaultExtra body content. | — |
spinnerThe Confirm button's spinner while | — |
Styling
- Parts
buttonbutton-spinnerbutton-labeldialogdialog-paneldialog-headerdialog-header-textdialog-titledialog-descriptiondialog-closedialog-bodydialog-footer- States
data-button-variantdata-button-sizedata-button-full-widthdata-button-disableddata-button-loadingdata-dialog-sizedata-dialog-flush
Keyboard
| Keys | Action |
|---|---|
Escape | Cancel |
Tab | Cycle between the buttons |
Accessibility
- The backdrop doesn't close it.
- With
danger, Cancel gets initial focus.