Confirm popover

A small popover that asks before a destructive action, right beside what asked.

Easter invite.psd
Sermon slides.key
Lobby banner.ai
Installation
$Terminal
npx shadcn@latest add https://sdk-components.thesqd.com/r/confirm-popover.json
Usage
Hold what is pending in state, open with the element that asked as the anchor.
TSImport
import { ConfirmPopover } from "@/components/ui/confirm-popover";
TSExample
const [anchor, setAnchor] = React.useState<Element | null>(null);

<Button onClick={(e) => setAnchor(e.currentTarget)}>Delete</Button>
<ConfirmPopover
  open={anchor !== null}
  onOpenChange={(open) => !open && setAnchor(null)}
  anchor={anchor}
  title="Delete this step?"
  description="Its connections go with it."
  onConfirm={deleteStep}
/>
Composition
Anatomy of ConfirmPopover.
ConfirmPopover                   (flat — no slots to compose)
├── anchor                       (the element that asked; the popover sits beside it)
├── title / description          (PopoverHeader → PopoverTitle + PopoverDescription)
└── one destructive Button       (actionLabel; runs onConfirm, then closes)

No Cancel button: clicking away or Esc cancels.
One item
Each row's trash button anchors the question to itself.
Easter invite.psd
Sermon slides.key
Lobby banner.ai
Several at once
One popover for a whole selection; the title carries the count.
Easter invite.psd
Sermon slides.key
Lobby banner.ai
API Reference
Props exposed by ConfirmPopover.
PropTypeDefaultDescription
openboolean—Whether the popover is showing.
onOpenChange(open: boolean) => void—Called on click-away, Esc, and after the button runs.
anchorElement | null—The element that asked; the popover is positioned beside it.
titleReactNode—The question, e.g. "Delete 2 steps?".
descriptionReactNode—Optional line under the title.
actionLabelReactNode"Delete"The red button's label.
onConfirm() => void—Runs on the button. The popover closes itself afterwards.
side"top" | "right" | "bottom" | "left""bottom"Side of the anchor to sit on.
align"start" | "center" | "end""start"Alignment along that side.