Skip to content

ConfirmPopup ​

Confirm inside a popover

A quick "are you sure?" next to the button that asked, for a small step that can't be taken back — delete a draft, revoke a share link. If it can be taken back, don't ask: do it and offer Undo from a Toaster. For something serious, where the whole page should stop, use an AlertDialog.

Basic

Not inside <p>

The floating panel is a <div>. HTML closes a <p> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.

  • Opening moves focus to Cancel, the safe choice; confirming or cancelling returns it to the trigger.
  • @confirm / @cancel; name the action in confirmLabel ("Remove", not "OK").

Usage ​

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

API ​

Props

NameTypeDefaultDescription
message*string—
titlestring—
confirmLabelstring"Confirm"
cancelLabelstring"Cancel"
color"text" | "accent" | "danger""text"
placementPlacement"bottom"
openbooleanfalse

Events

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

Slots

NameScopeDescription
trigger{ open: boolean; }

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