Skip to content

Popconfirm

Popconfirm asks for confirmation right next to the control that triggers an action, instead of a modal. It is a click-triggered Popover with a question and Cancel / Confirm buttons.

Demos

Basic

Focus moves to Cancel when it opens (the safe choice), Escape or a click outside cancels, and focus returns to the trigger when it closes.

Async and cancelled confirmation

Return a promise from onPositiveClick and Confirm shows a spinner until it settles. Return false (or a promise of false) to keep the popconfirm open.

Buttons, icon and actions

positiveText={null} or negativeText={null} hides a button, showIcon={false} hides the icon, and action replaces both buttons.

Props

NameTypeDefaultDescriptionVersion
contentReactNodeundefinedThe question.Unreleased
positiveTextReactNode | nulllocale “Confirm”Confirm button text; null hides it.Unreleased
negativeTextReactNode | nulllocale “Cancel”Cancel button text; null hides it.Unreleased
positiveButtonPropsPartial<ButtonProps>undefinedExtra props for Confirm, such as type: "error" for a destructive action.Unreleased
negativeButtonPropsPartial<ButtonProps>undefinedExtra props for Cancel.Unreleased
showIconbooleantrueShow the warning icon.Unreleased
iconReactNodeundefinedReplaces the warning icon.Unreleased
actionReactNodeundefinedReplaces both buttons.Unreleased
onPositiveClick(event: MouseEvent) => boolean | void | Promise<boolean | void>undefinedCalled by Confirm. false keeps it open; a promise shows a spinner.Unreleased
onNegativeClick(event: MouseEvent) => boolean | void | Promise<boolean | void>undefinedCalled by Cancel. false keeps it open.Unreleased

It also takes every Popover prop except header and footer; trigger defaults to click. The surface is an alertdialog.