AlertDialog
Confirm dialog
A question that must be answered before going on, usually before something that can't be undone — delete, discard, leave. For information that needs no answer, use a Toast or an Alert; for a quick confirm next to the button, ConfirmPopup. If the action can be reversed, don't ask: do it and offer Undo in a toast.
Basic
- It is read as an alert dialog with its title and
description. Focus starts on Cancel, the safe choice; Esc also cancels. - Clicking outside doesn't close it.
@confirmand@cancelsay which way it went;loadingholds the confirm button while you work. - Name the action in the button (
confirmLabel="Delete"), not "OK".
Usage
ts
import { BlessAlertDialog } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
title* | string | — | |
description | string | — | |
confirmLabel | string | "Confirm" | |
cancelLabel | string | "Cancel" | |
color | "text" | "accent" | "danger" | "danger" | confirm button color |
loading | boolean | — | |
modelValue | boolean | false |
Events
| Name | Payload | Description |
|---|---|---|
cancel | [] | |
update:modelValue | [value: boolean] | |
confirm | [] |
Slots
| Name | Scope | Description |
|---|---|---|
default | — |