Skip to content

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

Delete project?

This permanently removes the project and its 12 files.

  • 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. @confirm and @cancel say which way it went; loading holds 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

NameTypeDefaultDescription
title*string—
descriptionstring—
confirmLabelstring"Confirm"
cancelLabelstring"Cancel"
color"text" | "accent" | "danger""danger"confirm button color
loadingboolean—
modelValuebooleanfalse

Events

NamePayloadDescription
cancel[]
update:modelValue[value: boolean]
confirm[]

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.