The Popconfirm Component is an interactive tool designed to verify user actions before they're finalized. Ideal for confirming deletions, submissions, or any significant step, it enhances user experience by preventing accidental decisions and ensuring deliberate actions.
Anatomy
This component features a trigger (usually a button), a floating confirmation dialog that appears upon interaction, containing a message area, confirm and cancel buttons, and optionally, an icon for added emphasis.
Properties
The Popconfirm Component offers various properties to customize its appearance and functionality, ensuring it fits seamlessly into any application or workflow.
Size
Status
Orientation
Small
Success
Right - Middle
Medium
Info
Right - Up
Large
Error
Right - Down
Warning
Left - Middle
Attention
Left - Up
Left - Down
Top - Left
Top - Right
Top - Middle
Bottom - Middle
Bottom - Left
Bottom - Right
Size
Small size popconfirm component is a compact design for brief messages.
Medium size popcobfirm component is Balanced size for most applications.
Large size popconfirm component is expanded view for detailed confirmation messages.
import React from'react';import { PlusPopconfirm, PlusButton } from'@plusui/react';// Small Size PopconfirmconstPopconfirmSmall= () => ( <PlusPopconfirmsize="sm"title="Delete File?"description="Are you sure you want to delete this file? This action cannot be undone."status="warning"trigger="click" > <PlusButtonstatus="error">Delete File</PlusButton> </PlusPopconfirm>);// Medium Size PopconfirmconstPopconfirmMedium= () => ( <PlusPopconfirmsize="md"title="Send Email?"description="Are you sure you want to send this email? You won't be able to edit it afterwards."status="info"trigger="click" > <PlusButton>Send Email</PlusButton> </PlusPopconfirm>);// Large Size PopconfirmconstPopconfirmLarge= () => ( <PlusPopconfirmsize="lg"title="Submit Form?"description="Are you sure you want to submit this form? Please check your inputs before proceeding."status="primary"trigger="click" > <PlusButton>Submit Form</PlusButton> </PlusPopconfirm>);exportdefault { PopconfirmSmall, PopconfirmMedium, PopconfirmLarge,};
<!-- Small Size Popconfirm --><plus-popconfirmsize="sm"title="Delete File?"description="Are you sure you want to delete this file? This action cannot be undone."status="warning"trigger="click"> <plus-buttonstatus="error">Delete File</plus-button></plus-popconfirm><!-- Medium Size Popconfirm --><plus-popconfirmsize="md"title="Send Email?"description="Are you sure you want to send this email? You won't be able to edit it afterwards."status="info"trigger="click"> <plus-button>Send Email</plus-button></plus-popconfirm><!-- Large Size Popconfirm --><plus-popconfirmsize="lg"title="Submit Form?"description="Are you sure you want to submit this form? Please check your inputs before proceeding."status="primary"trigger="click"> <plus-button>Submit Form</plus-button></plus-popconfirm>
<template><!-- Small Size Popconfirm --> <plus-popconfirmsize="sm"title="Delete File?"description="Are you sure you want to delete this file? This action cannot be undone."status="warning"trigger="click" > <plus-buttonstatus="error">Delete File</plus-button> </plus-popconfirm><!-- Medium Size Popconfirm --> <plus-popconfirmsize="md"title="Send Email?"description="Are you sure you want to send this email? You won't be able to edit it afterwards."status="info"trigger="click" > <plus-button>Send Email</plus-button> </plus-popconfirm><!-- Large Size Popconfirm --> <plus-popconfirmsize="lg"title="Submit Form?"description="Are you sure you want to submit this form? Please check your inputs before proceeding."status="primary"trigger="click" > <plus-button>Submit Form</plus-button> </plus-popconfirm></template>
<!-- Small Size Popconfirm --><plus-popconfirmsize="sm"title="Delete File?"description="Are you sure you want to delete this file? This action cannot be undone."status="warning"trigger="click"> <plus-buttonstatus="error">Delete File</plus-button></plus-popconfirm><!-- Medium Size Popconfirm --><plus-popconfirmsize="md"title="Send Email?"description="Are you sure you want to send this email? You won't be able to edit it afterwards."status="info"trigger="click"> <plus-button>Send Email</plus-button></plus-popconfirm><!-- Large Size Popconfirm --><plus-popconfirmsize="lg"title="Submit Form?"description="Are you sure you want to submit this form? Please check your inputs before proceeding."status="primary"trigger="click"> <plus-button>Submit Form</plus-button></plus-popconfirm>
Status
Success status popconfirm component indicates a successful action needing confirmation.
Info status popconfirm component provides information requiring user acknowledgment.
Error status popconfirm component alerts to an error that needs user confirmation to proceed.
Warning status popconfirm component warns the user about potential risks or consequences.
Attention status popconfirm component draws attention to critical information or choices.
import React from'react';import { PlusPopconfirm, PlusButton } from'@plusui/react';// Success StatusconstPopconfirmSuccess= () => ( <PlusPopconfirmstatus="success"title="Action Successful"description="Your action has been successfully completed."trigger="click" > <PlusButton>Continue</PlusButton> </PlusPopconfirm>);// Warning StatusconstPopconfirmWarning= () => ( <PlusPopconfirmstatus="warning"title="Are You Sure?"description="This action could have unintended consequences. Proceed with caution."trigger="click" > <PlusButton>Proceed</PlusButton> </PlusPopconfirm>);// Error StatusconstPopconfirmError= () => ( <PlusPopconfirmstatus="error"title="Action Failed"description="An error occurred during the process. Please try again."trigger="click" > <PlusButton>Retry</PlusButton> </PlusPopconfirm>);// Info StatusconstPopconfirmInfo= () => ( <PlusPopconfirmstatus="info"title="Information"description="Here's some important information you should know."trigger="click" > <PlusButton>Got It</PlusButton> </PlusPopconfirm>);// Default StatusconstPopconfirmDefault= () => ( <PlusPopconfirmstatus="default"title="Confirmation Needed"description="Are you sure you want to proceed with this action?"trigger="click" > <PlusButton>Confirm</PlusButton> </PlusPopconfirm>);exportdefault { PopconfirmSuccess, PopconfirmWarning, PopconfirmError, PopconfirmInfo, PopconfirmDefault,};
<!-- Success Status --><plus-popconfirmstatus="success"title="Action Successful"description="Your action has been successfully completed."trigger="click"> <plus-button>Continue</plus-button></plus-popconfirm> <!-- Success state --><!-- Warning Status --><plus-popconfirmstatus="warning"title="Are You Sure?"description="This action could have unintended consequences. Proceed with caution."trigger="click"> <plus-button>Proceed</plus-button></plus-popconfirm> <!-- Warning state --><!-- Error Status --><plus-popconfirmstatus="error"title="Action Failed"description="An error occurred during the process. Please try again."trigger="click"> <plus-button>Retry</plus-button></plus-popconfirm> <!-- Error state --><!-- Info Status --><plus-popconfirmstatus="info"title="Information"description="Here's some important information you should know."trigger="click"> <plus-button>Got It</plus-button></plus-popconfirm> <!-- Info state --><!-- Default Status --><plus-popconfirmstatus="default"title="Confirmation Needed"description="Are you sure you want to proceed with this action?"trigger="click"> <plus-button>Confirm</plus-button></plus-popconfirm> <!-- Default state -->
<template><!-- Success Status --> <plus-popconfirmstatus="success"title="Action Successful"description="Your action has been successfully completed."trigger="click" > <plus-button>Continue</plus-button> </plus-popconfirm> <!-- Success state --><!-- Warning Status --> <plus-popconfirmstatus="warning"title="Are You Sure?"description="This action could have unintended consequences. Proceed with caution."trigger="click" > <plus-button>Proceed</plus-button> </plus-popconfirm> <!-- Warning state --><!-- Error Status --> <plus-popconfirmstatus="error"title="Action Failed"description="An error occurred during the process. Please try again."trigger="click" > <plus-button>Retry</plus-button> </plus-popconfirm> <!-- Error state --><!-- Info Status --> <plus-popconfirmstatus="info"title="Information"description="Here's some important information you should know."trigger="click" > <plus-button>Got It</plus-button> </plus-popconfirm> <!-- Info state --><!-- Default Status --> <plus-popconfirmstatus="default"title="Confirmation Needed"description="Are you sure you want to proceed with this action?"trigger="click" > <plus-button>Confirm</plus-button> </plus-popconfirm> <!-- Default state --><!-- Attention status --> <plus-popconfirmstatus="attention"title="Please Note"description="This action requires your full attention. Proceed with caution."trigger="click" > <plus-button>Proceed</plus-button> </plus-popconfirm> <!-- Attention status --></template>
<!-- Success Status --><plus-popconfirmstatus="success"title="Action Successful"description="Your action has been successfully completed."trigger="click"> <plus-button>Continue</plus-button></plus-popconfirm><!-- Success state --><!-- Warning Status --><plus-popconfirmstatus="warning"title="Are You Sure?"description="This action could have unintended consequences. Proceed with caution."trigger="click"> <plus-button>Proceed</plus-button></plus-popconfirm><!-- Warning state --><!-- Error Status --><plus-popconfirmstatus="error"title="Action Failed"description="An error occurred during the process. Please try again."trigger="click"> <plus-button>Retry</plus-button></plus-popconfirm><!-- Error state --><!-- Info Status --><plus-popconfirmstatus="info"title="Information"description="Here's some important information you should know."trigger="click"> <plus-button>Got It</plus-button></plus-popconfirm><!-- Info state --><!-- Default Status --><plus-popconfirmstatus="default"title="Confirmation Needed"description="Are you sure you want to proceed with this action?"trigger="click"> <plus-button>Confirm</plus-button></plus-popconfirm><!-- Default state --><plus-popconfirmstatus="attention"title="Please Note"description="This action requires your full attention. Proceed with caution."trigger="click"> <plus-button>Proceed</plus-button></plus-popconfirm><!-- Attention status -->
Orientation
Specifies the position of the Popconfirm relative to the trigger element:
Right - Middle popconfirm component aligns the center of the Popconfirm to the right.
Right - Up popconfirm component aligns the Popconfirm above and to the right.
Right - Down popconfirm component aligns the Popconfirm below and to the right.
Left - Middle popconfirm component aligns the center of the Popconfirm to the left.
Left - Up popconfirm component aligns the Popconfirm above and to the left.
Left - Down popconfirm component aligns the Popconfirm below and to the left.
Top - Middle popconfirm component centers the Popconfirm above the trigger.
Top - Up popconfirm component positions the Popconfirm slightly above the center-top.
Top - Down popconfirm component positions the Popconfirm just below the top alignment.
Bottom - Middle popconfirm component centers the Popconfirm below the trigger.
Bottom - Up popconfirm component positions the Popconfirm just above the bottom alignment.
Bottom - Down popconfirm component positions the Popconfirm slightly below the center-bottom.
import React from'react';import { PlusPopconfirm, PlusButton } from'@plusui/react';// Top PlacementconstPopconfirmTop= () => ( <PlusPopconfirmplacement="top"title="Confirmation Needed"description="This action requires your approval."trigger="click" > <PlusButton>Top Placement</PlusButton> </PlusPopconfirm>);// Bottom PlacementconstPopconfirmBottom= () => ( <PlusPopconfirmplacement="bottom"title="Confirmation Needed"description="Are you sure you want to proceed?"trigger="click" > <PlusButton>Bottom Placement</PlusButton> </PlusPopconfirm>);// Left PlacementconstPopconfirmLeft= () => ( <PlusPopconfirmplacement="left"title="Confirmation Needed"description="Do you really want to perform this action?"trigger="click" > <PlusButton>Left Placement</PlusButton> </PlusPopconfirm>);// Right PlacementconstPopconfirmRight= () => ( <PlusPopconfirmplacement="right"title="Confirmation Needed"description="Please confirm your action."trigger="click" > <PlusButton>Right Placement</PlusButton> </PlusPopconfirm>);exportdefault { PopconfirmTop, PopconfirmBottom, PopconfirmLeft, PopconfirmRight,};
<!-- Top Placement --><plus-popconfirmplacement="top"title="Confirmation Needed"description="This action requires your approval."trigger="click"> <plus-button>Top Placement</plus-button></plus-popconfirm> <!-- Opens from the top --><!-- Bottom Placement --><plus-popconfirmplacement="bottom"title="Confirmation Needed"description="Are you sure you want to proceed?"trigger="click"> <plus-button>Bottom Placement</plus-button></plus-popconfirm> <!-- Opens from the bottom --><!-- Left Placement --><plus-popconfirmplacement="left"title="Confirmation Needed"description="Do you really want to perform this action?"trigger="click"> <plus-button>Left Placement</plus-button></plus-popconfirm> <!-- Opens from the left --><!-- Right Placement --><plus-popconfirmplacement="right"title="Confirmation Needed"description="Please confirm your action."trigger="click"> <plus-button>Right Placement</plus-button></plus-popconfirm> <!-- Opens from the right -->
<template><!-- Top Placement --> <plus-popconfirmplacement="top"title="Confirmation Needed"description="This action requires your approval."trigger="click" > <plus-button>Top Placement</plus-button> </plus-popconfirm> <!-- Opens from the top --><!-- Bottom Placement --> <plus-popconfirmplacement="bottom"title="Confirmation Needed"description="Are you sure you want to proceed?"trigger="click" > <plus-button>Bottom Placement</plus-button> </plus-popconfirm> <!-- Opens from the bottom --><!-- Left Placement --> <plus-popconfirmplacement="left"title="Confirmation Needed"description="Do you really want to perform this action?"trigger="click" > <plus-button>Left Placement</plus-button> </plus-popconfirm> <!-- Opens from the left --><!-- Right Placement --> <plus-popconfirmplacement="right"title="Confirmation Needed"description="Please confirm your action."trigger="click" > <plus-button>Right Placement</plus-button> </plus-popconfirm> <!-- Opens from the right --></template>
<!-- Success Status --><plus-popconfirmstatus="success"title="Action Successful"description="Your action has been successfully completed."trigger="click"> <plus-button>Continue</plus-button></plus-popconfirm><!-- Success state --><!-- Warning Status --><plus-popconfirmstatus="warning"title="Are You Sure?"description="This action could have unintended consequences. Proceed with caution."trigger="click"> <plus-button>Proceed</plus-button></plus-popconfirm><!-- Warning state --><!-- Error Status --><plus-popconfirmstatus="error"title="Action Failed"description="An error occurred during the process. Please try again."trigger="click"> <plus-button>Retry</plus-button></plus-popconfirm><!-- Error state --><!-- Info Status --><plus-popconfirmstatus="info"title="Information"description="Here's some important information you should know."trigger="click"> <plus-button>Got It</plus-button></plus-popconfirm><!-- Info state --><!-- Default Status --><plus-popconfirmstatus="default"title="Confirmation Needed"description="Are you sure you want to proceed with this action?"trigger="click"> <plus-button>Confirm</plus-button></plus-popconfirm><!-- Default state --><plus-popconfirmstatus="attention"title="Please Note"description="This action requires your full attention. Proceed with caution."trigger="click"> <plus-button>Proceed</plus-button></plus-popconfirm><!-- Attention status -->
Layout & Spacing
The Popconfirm Component is designed with clear spacing around the message and buttons, ensuring it's easy to read and interact with. Its layout is optimized for visibility without overwhelming the underlying content.
Light & Dark Mode
Supports both light and dark modes, adapting to the application's theme to maintain consistency and reduce visual strain.
Accessibility
Accessibility features include keyboard navigation, screen reader support, and ARIA attributes, making sure the confirmation process is inclusive and straightforward for all users.
Criteria
Description
Status
ARIA Role
Ensures role attribute has an appropriate value for the element
✔️ Passed
ARIA Hidden Elements
Ensures aria-hidden elements are not focusable nor contain focusable elements
✔️ Passed
ID Attributes
Ensures every id attribute value is unique
✔️ Passed
Color Contrast
Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds