JGuang

Popconfirm

Popconfirm · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Popconfirm

A simple confirmation box of an action.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: The simplest usage.
  • Internationalization: Custom button text.
  • Position: The Popconfirm supports 12 different directions. They are: top left, top, top right, bottom left, bottom, bottom right, left top, left, left bottom, right top, right , bottom right.
  • Delay close: Used to perform certain operations asynchronously, and close the popup after the operation is completed. Usage: Return a Promise for asynchronous closing.
  • Customize icon: Customize icon.

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Popconfirm

PropertyDescriptionTypeDefaultValueVersion
autoFocusWhether to automatically focus the first focusable element in the confirmation boxboolean--
defaultPopupVisibleWhether the confirmation box is visible by defaultboolean--
disabledwhether to disabledboolean-2.11.0
focusLockWhether to lock the focus in the confirmation boxboolean--
popupVisibleWhether the confirmation box is visibleboolean--
unmountOnExitWhether to destroy the confirmation box when hiddenbooleantrue-
okTypeThe type of the ok buttonButtonProps['type']primary-
positionThe position of the confirmation box relative to the target.| 'top'| 'tl'| 'tr'| 'bottom'| 'bl'| 'br'| 'left'| 'lt'| 'lb'| 'right'| 'rt'| 'rb'top-
triggerTrigger modeTriggerProps['trigger']click-
cancelTextThe text of the cancel buttonReactNode--
iconCustomize icon of the confirmation boxReactNode<IconExclamationCircleFill />-
okTextThe text of the ok buttonReactNode--
cancelButtonPropsThe props of the cancel buttonButtonProps--
classNameAdditional css classstring | string[]--
okButtonPropsThe props of the ok buttonButtonProps--
onOkCallback when click the ok button. Callback event params is supported in 2.29.0(e: React.MouseEvent) => Promise<any> | void--
styleAdditional styleCSSProperties--
triggerPropsThe Props of the Trigger componentPartial<TriggerProps>--
contentContent of PopconfirmFunction types are supported in 2.48.0ReactNode | (() => ReactNode)-2.44.0
getPopupContainerThe parent node which the confirmation box will be rendered to.(node: HTMLElement) => Element--
onCancelCallback when click the cancel button. Callback event params is supported in 2.29.0(e: React.MouseEvent) => void--
onVisibleChangeCallback when the visibility of the confirmation box is changed(visible: boolean) => void--
titleTitle of Popconfirm. Function types are supported in 2.48.0ReactNode | (() => ReactNode)--