Skip to content

Popconfirm

Displays a confirmation dialog in a floating panel near a target element.

First release: 1.0.0 Latest update: July 1, 2025 Current version: 1.0.0

React Angular Vue Svelte HTML

Import

import { PlusPopconfirm } from '@plusui/react';
import { PlusPopconfirmComponent } from '@plusui/angular';
import { PlusPopconfirm } from '@plusui/vue';
import PlusPopconfirm from '@plusui/svelte';
<script src="https://cdn.jsdelivr.net/npm/@plusui/core"></script>

Package

@plusui/react
@plusui/angular
@plusui/vue
@plusui/svelte
@plusui/core

Docs

Changelog

Popconfirm Changelog

Recent changes and updates for the popconfirm component

v1.0.0

June 20, 2025
Feat

Added Popconfirm for confirmation dialogs

  • Confirmation before action
  • Customizable messages
  • Multiple status variants
  • Accessibility support

The Popconfirm component displays a small overlay confirmation dialog next to a target element, requiring the user to confirm an action. It’s useful for actions like deleting items or submitting forms.

Popconfirm - anatomy

A basic popconfirm triggered by clicking a button.

This action cannot be undone.
Delete
Show code

Use the orientation prop to control where the popconfirm appears relative to the trigger element.

Top StartTopTop End
Left StartLeftLeft End
Right StartRightRight End
Bottom StartBottomBottom End
Show code

The trigger prop determines how the popconfirm is opened.

ClickHover
Show code

Use the status prop to apply different color schemes, often indicating the severity or type of action being confirmed.

DefaultPrimarySuccessWarningDangerInfo
Show code

Use slots title and content for more complex content than simple strings.

Custom Title

This is custom content with HTML.

Show Custom
Show code
Popconfirm - layout spacing Popconfirm - light & dark mode
  • Keyboard Behavior:
    • When the popconfirm is opened, focus is typically moved inside the dialog, usually to the first focusable element (like the Cancel or Confirm button).
    • Tab and Shift+Tab navigate between focusable elements within the popconfirm (title, content if focusable, Cancel button, Confirm button, Close button if present). Focus is trapped within the dialog.
    • Escape closes the popconfirm and returns focus to the trigger element.
    • Enter or Space activates the focused button (Confirm, Cancel, Close).
  • Screen Reader:
    • The component uses role="dialog", aria-modal="true", aria-labelledby (pointing to the title element), and aria-describedby (pointing to the content element).
    • When opened, screen readers announce the dialog’s role, title, and description.
    • Buttons (Confirm, Cancel, Close) have accessible names derived from their text content or aria-label if using custom slots.
  • Required Developer Actions:
    • Ensure the trigger element (in the default slot) is inherently focusable or has tabindex="0".
    • Provide clear and concise text for the title prop or title slot.
    • Provide descriptive content in the content slot.
    • If using custom content in title or content slots, ensure it’s accessible.
    • Use appropriate status values to convey semantic meaning.
NameTypeDefaultDescriptionRequired
size'sm' | 'md' | 'lg''md'Size of the popconfirm dialog.No
orientation'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end''top'Position relative to the trigger element.No
trigger'click' | 'hover''click'How the popconfirm is opened.No
titlestring'Are you sure?'Title text displayed in the header. Use title slot for custom HTML.No
confirmTextstring'Confirm'Text for the confirm button.No
cancelTextstring'Cancel'Text for the cancel button.No
status'success' | 'warning' | 'danger' | 'info' | 'primary' | 'default''default'Color scheme and default icon based on status.No
statusIconbooleantrueWhether to show the default status icon.No
showArrowbooleantrueWhether to display the arrow pointing to the trigger element.No
NamePayload TypeDescription
plus-popconfirm-openCustomEvent<void>Fired when the popconfirm opens.
plus-popconfirm-closeCustomEvent<void>Fired when the popconfirm closes.
plus-popconfirm-confirmCustomEvent<void>Fired when the confirm button is clicked.
plus-popconfirm-cancelCustomEvent<void>Fired when the cancel button is clicked.
NameDescription
default (unnamed)The target element that triggers the popconfirm.
iconCustom icon content, replaces the default status icon.
titleCustom title content, overrides the title prop.
headerCustom header content, replaces the entire default header section.
footerCustom footer content, replaces the entire default footer section.
contentThe main descriptive content inside the popconfirm body.
PartDescription
popconfirmThe main popconfirm container element.
arrowThe arrow element pointing to the trigger.
headerThe header section container.
titleThe title element container.
contentThe main content area container.
footerThe footer section container.

Join the Community

Plus UI is built by the community. Join us on our platforms to contribute, get help, and stay up to date.