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

ConfirmPopup ​

Confirm inside a popover

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

Basic

Not inside <p>

The floating panel is a <div>. HTML closes a <p> at a <div>. For this reason, a trigger placed inside a paragraph renders differently on the server and the client. Wrap it in a <span> or <div> instead.

  • Opening moves focus to Cancel, the safe choice. Confirming or canceling returns it to the trigger.
  • @confirm / @cancel. Name the action in labels.confirm ("Remove", not "OK").

Usage ​

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

API ​

Props

NameTypeDefaultDescription
message*string—
titlestring—
color"text" | "accent" | "danger""text"
placementPlacement"bottom"
labelsPartial<{ confirm: string; cancel: string; }>—
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.