Skip to content
Calm motion: animations on this site only fade, with no movement

AlertDialog ​

Confirm dialog

A question that must be answered before going on, usually before something that cannot 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, do not 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 does not close it. @confirm and @cancel say which way it went. loading holds the confirm button while you work.
  • Name the action in the button (:labels="{ confirm: 'Delete' }"), not "OK".

Usage ​

ts
import { BlessAlertDialog } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
title*string—
descriptionstring—
color"text" | "accent" | "danger""danger"confirm button color
loadingboolean—
labelsPartial<{ confirm: string; cancel: string; }>—
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.