Skip to content
Protocore Design Systemv1.6.9

/// Overlay

Popconfirm

A small confirm bubble anchored to its trigger — a title plus confirm/cancel — for low-stakes actions that still deserve a second tap.

import { Popconfirm } from "@protocore/pds";
View as Markdown

Basics

Wrap the control that triggers the action. The bubble opens anchored to it with a title, an optional description, and confirm/cancel buttons. Confirming or cancelling closes the bubble and leaves the trigger in place.

Placement

side (top default, right, bottom, left) and align position the bubble against the trigger; placement is collision-aware and flips to stay on screen.

When to use it

A Popconfirm is the inline gut-check for a reversible or low-consequence action — remove a filter, revoke a dev key, discard a draft — where a full modal would be too heavy but a bare click is too easy to trigger by accident. It keeps the user in context, right next to the button they pressed.

Escalate to an [AlertDialog](/overlay/alert-dialog) or [ModalsProvider](/overlay/modals-provider) openConfirm when the action is genuinely destructive and irreversible — a centered, backdropped prompt commands more attention than a bubble. Use a plain [Popover](/overlay/popover) when you need arbitrary anchored content rather than a yes/no decision.

Usage

Do

  • Use it for low-stakes, reversible actions next to their trigger.
  • Set tone="danger" for removals so the confirm button reads as destructive.
  • Keep the title to a single question; add one line of description if needed.
  • Wrap the real trigger control as the child — it becomes the anchor.

Don't

  • Use a bubble for irreversible, high-blast-radius actions — reach for AlertDialog.
  • Cram a form into it; it's a yes/no decision, not a panel.
  • Stack a Popconfirm on top of another overlay.
  • Write a paragraph in the title — that's what description is for.

Accessibility

KeysAction
Enter / SpaceOn the trigger, opens the bubble.
TabMoves between the cancel and confirm buttons.
EscCloses the bubble without confirming.
  • The bubble is role=alertdialog, labelled by its title and described by its description.
  • Built on Radix Popover: focus moves into the bubble and returns to the trigger on close.
  • Both actions are real buttons — keyboard-reachable and screen-reader friendly.

Popconfirm props

PropTypeDefaultDescription
alignenumcenterAlignment along that side.
cancelLabelstringCancelLabel for the cancel action.
children *ReactNodeThe control that opens the bubble — rendered via `asChild`.
classNamestringExtra class on the bubble panel.
confirmLabelstringConfirmLabel for the confirm action.
defaultOpenbooleanUncontrolled initial open state.
descriptionReactNodeOptional supporting copy explaining the consequence.
onCancel(() => void)Called when the user cancels (button or dismissal).
onConfirm(() => void)Called when the user confirms.
onOpenChange((open: boolean) => void)Fires when the open state changes.
openbooleanControlled open state.
sideenumtopSide of the trigger to render on.
title *ReactNodeHeading of the confirmation.
toneenumdangerSeverity of the confirm action — danger renders the destructive button.

Related

  • PopoverA non-modal floating panel anchored to a trigger — for secondary controls, filters, and rich detail that shouldn't block the page.
  • AlertDialogA modal that interrupts to confirm a consequential or destructive action — no backdrop escape, an explicit choice required.
  • ModalsProviderAn imperative modal manager: open Dialogs and confirm prompts from anywhere with a hook call, no JSX in your view.
  • DropdownMenuA menu of actions opened from a button — items, checkboxes, radio groups, and nested submenus with full keyboard navigation.