Introducing PrimeReact v11-alpha 🎉Discover Now

ConfirmPopup

An unstyled confirm popup component with alertdialog role, focus management, and outside click dismissal.

Build fully custom confirmation popups with complete control over layout and styling.

basic-demo

Pre-styled Versions

Choose a pre-styled library to use ConfirmPopup with ready-made designs.
For hook-based usage without components, see the Headless API.

Features#

  • Compound component API with sub-components: Root, Trigger, Portal, Positioner, Popup, Arrow, Content, Icon, Message, Footer, Close
  • Built-in alertdialog role on the popup element for confirmation semantics
  • Multiple Close buttons for distinct actions (e.g., Cancel and Save)
  • Arrow element support for visual connection to the trigger

Usage#

import { ConfirmPopup } from 'primereact/confirmpopup';
<ConfirmPopup.Root>
    <ConfirmPopup.Trigger></ConfirmPopup.Trigger>
    <ConfirmPopup.Portal>
        <ConfirmPopup.Positioner sideOffset={12}>
            <ConfirmPopup.Popup>
                <ConfirmPopup.Arrow />
                <ConfirmPopup.Content>
                    <ConfirmPopup.Icon />
                    <ConfirmPopup.Message></ConfirmPopup.Message>
                </ConfirmPopup.Content>
                <ConfirmPopup.Footer>
                    <ConfirmPopup.Close></ConfirmPopup.Close>
                    <ConfirmPopup.Close></ConfirmPopup.Close>
                </ConfirmPopup.Footer>
            </ConfirmPopup.Popup>
        </ConfirmPopup.Positioner>
    </ConfirmPopup.Portal>
</ConfirmPopup.Root>

Behavior#

Motion Animation#

<ConfirmPopup.Popup motionProps={{ name: 'p-confirmpopup' }}>...</ConfirmPopup.Popup>

See Motion for animation phases, CSS variables, and hide strategies.

Polymorphic Rendering#

Use as on any sub-component to change the rendered HTML element.

<ConfirmPopup.Close as="a">Cancel</ConfirmPopup.Close>

Render Function Children#

Sub-components accept a render function as children, providing access to the component instance.

<ConfirmPopup.Trigger>{(instance) => <span>{instance.confirmpopup?.state.open ? 'Close' : 'Open'}</span>}</ConfirmPopup.Trigger>

Pass Through#

Some parts may not be visible in the preview depending on the component's current state.

Loading...
/* Select a part to see its CSS selector for custom styling */

API#

ConfirmPopupRoot#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupRootInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupRootInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupRootInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupRootPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupRootInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
defaultOpenbooleanundefined
Whether the popover is open by default.
openbooleanundefined
Whether the popover is open.
trappedbooleanfalse
When enabled, focus is trapped within the popover (modal behavior). When disabled, focus leaving the popover closes it (non-modal behavior).
autoFocusbooleantrue
Whether to focus the first focusable element when the popover is opened.
closeOnEscapebooleantrue
Specifies if pressing escape key should hide the dialog.
onOpenChange(event: usePopoverOpenChangeEvent) => voidundefined
Callback to invoke when the open state changes.
appendTo"body" | HTMLElement | "self"'body'
DOM element or CSS selector to append the overlay to.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopup component.

labeltypedescription
rootConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.
triggerConfirmPopupRootPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the trigger's DOM element.
positionerConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the positioner's DOM element.
popupConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the popup's DOM element.
arrowConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the arrow's DOM element.
contentConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the content's DOM element.
iconConfirmPopupRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the icon's DOM element.
messageConfirmPopupRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the message's DOM element.
footerConfirmPopupRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the footer's DOM element.
closeConfirmPopupRootPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the close's DOM element.

ConfirmPopupTrigger#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupTriggerInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupTriggerInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupTriggerInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupTriggerPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupTriggerInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-positioner-openPresent when confirm popup is open
data-openPresent when confirm popup is open

Defines passthrough(pt) options of ConfirmPopupTrigger component.

labeltypedescription
rootConfirmPopupTriggerPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupPortal#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupPortalInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupPortalInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupPortalInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupPortalPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupPortalInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupPortal component.

labeltypedescription
rootConfirmPopupPortalPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupPositioner#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupPositionerInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupPositionerInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupPositionerInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupPositionerPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupPositionerInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
sideSideType
The side of the positioner.
alignAlignType
The align of the positioner.
sideOffsetnumber
The side offset of the positioner.
alignOffsetnumber
The align offset of the positioner.
flipboolean
Whether to flip the positioner.
shiftboolean
Whether to shift the positioner.
hideWhenDetachedboolean
Whether to hide the positioner when detached.
strategy"fixed" | "absolute"'fixed'
The positioning strategy.
boundaryHTMLElement
The boundary element that constrains the positioner placement. Used in JS fallback mode only; CSS Anchor mode uses the containing block.
anchorHTMLElement
The anchor element.
contentHTMLDivElement
The content element.
arrowHTMLDivElement
The arrow element.
autoZIndexbooleantrue
Whether to automatically manage layering.
baseZIndexnumber0
Base zIndex value to use in layering.
onPlacementChange(placement: { side: SideType; align: AlignType }) => void
Callback invoked when the actual placement changes due to flip or shift.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-openPresent when confirm popup is open
data-side"top" | "bottom" | "left" | "right" — placement
data-align"start" | "center" | "end" — alignment

CSS Custom Properties

The positioner element exposes CSS custom properties for layout and transform control.

CSS VariableDescription
--available-heightAvailable vertical space in pixels
--available-widthAvailable horizontal space in pixels
--transform-originComputed transform origin for animations
--positioner-anchor-widthWidth of the anchor/trigger element

Defines passthrough(pt) options of ConfirmPopupPositioner component.

labeltypedescription
rootConfirmPopupPositionerPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupPopup#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupPopupInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupPopupInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupPopupInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupPopupPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupPopupInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
motionPropsuseMotionProps
Used to apply motion to the popup element. It accepts the same properties as useMotion hook.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-openPresent when confirm popup is open
data-closedPresent when confirm popup is closed

Defines passthrough(pt) options of ConfirmPopupPopup component.

labeltypedescription
rootConfirmPopupPopupPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupArrow#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupArrowInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupArrowInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupArrowInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupArrowPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupArrowInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-side"top" | "bottom" | "left" | "right" — placement
data-align"start" | "center" | "end" — alignment

The arrow element exposes CSS custom properties for dynamic positioning:

CSS VariableDescription
--placer-arrow-xHorizontal offset of arrow
--placer-arrow-yVertical offset of arrow
--placer-arrow-leftLeft position of arrow element
--placer-arrow-topTop position of arrow element

Defines passthrough(pt) options of ConfirmPopupArrow component.

labeltypedescription
rootConfirmPopupArrowPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupContent#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupContentInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupContentInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupContentInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupContentPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupContentInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupContent component.

labeltypedescription
rootConfirmPopupContentPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupIcon#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupIconInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupIconInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupIconInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupIconPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupIconInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupIcon component.

labeltypedescription
rootConfirmPopupIconPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupMessage#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupMessageInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupMessageInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupMessageInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupMessagePassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupMessageInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupMessage component.

labeltypedescription
rootConfirmPopupMessagePassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupFooter#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupFooterInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupFooterInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupFooterInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupFooterPassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupFooterInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupFooter component.

labeltypedescription
rootConfirmPopupFooterPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

ConfirmPopupClose#

NameTypeDefault
refRef<unknown>
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmPopupCloseInstance) => CSSProperties)
The style to apply to the component.
classNamestring | ((instance?: ConfirmPopupCloseInstance) => string)
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceConfirmPopupCloseInstance
The instance to pass to the component.
ptSafeRecord<ConfirmPopupClosePassThrough>
The pass-through props to pass to the component.
ptOptionsPassThroughOptions
The pass-through options to pass to the component.
unstyledboolean
Whether the component should be rendered without classes.
dtunknown
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
The styles to use for the component.
render(instance: ConfirmPopupCloseInstance) => ReactNode
The render function to render the component with instance access.
childrenany
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any
pt-{optionName}-*-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmPopupClose component.

labeltypedescription
rootConfirmPopupClosePassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the root's DOM element.

Accessibility#

Screen Reader#

ConfirmPopup component uses alertdialog role. Attributes like aria-label or aria-labelledby can be passed to describe the popup contents. In addition aria-modal is added since focus is kept within the popup.

Overlay Keyboard Support#

KeyFunction
tabMoves focus to the next focusable element within the confirm popup.
shift + tabMoves focus to the previous focusable element within the confirm popup.
escapeCloses the popup and moves focus to the trigger.

Close Button Keyboard Support#

KeyFunction
enterTriggers the action, closes the popup and moves focus to the trigger.
spaceTriggers the action, closes the popup and moves focus to the trigger.