Introducing PrimeReact v11-alpha 🎉Discover Now

ConfirmDialog

An unstyled confirmation dialog component with icon, message, and action button composition.

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

basic-demo

Pre-styled Versions

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

Features#

  • Compound component API with sub-components: Root, Trigger, Portal, Backdrop, Positioner, Popup, Header, Title, HeaderActions, Close, Content, Icon, Message, Footer
  • Nine position modes: center, top, bottom, left, right, topleft, topright, bottomleft, bottomright
  • Integrated focus trap with automatic focus management on open and close
  • Dismissable Backdrop with click-outside detection
  • Dedicated Icon and Message sub-components for structured confirmation content

Usage#

import { ConfirmDialog } from 'primereact/confirmdialog';
<ConfirmDialog.Root>
    <ConfirmDialog.Trigger></ConfirmDialog.Trigger>
    <ConfirmDialog.Portal>
        <ConfirmDialog.Backdrop />
        <ConfirmDialog.Positioner>
            <ConfirmDialog.Popup>
                <ConfirmDialog.Header>
                    <ConfirmDialog.Title></ConfirmDialog.Title>
                    <ConfirmDialog.Close></ConfirmDialog.Close>
                </ConfirmDialog.Header>
                <ConfirmDialog.Content>
                    <ConfirmDialog.Icon />
                    <ConfirmDialog.Message></ConfirmDialog.Message>
                </ConfirmDialog.Content>
                <ConfirmDialog.Footer>
                    <ConfirmDialog.Close></ConfirmDialog.Close>
                    <ConfirmDialog.Close></ConfirmDialog.Close>
                </ConfirmDialog.Footer>
            </ConfirmDialog.Popup>
        </ConfirmDialog.Positioner>
    </ConfirmDialog.Portal>
</ConfirmDialog.Root>

Behavior#

Motion Animation#

<ConfirmDialog.Popup motionProps={{ name: 'p-confirmdialog', appear: true }}>...</ConfirmDialog.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.

<ConfirmDialog.Trigger as="div">...</ConfirmDialog.Trigger>
<ConfirmDialog.Icon as="i">...</ConfirmDialog.Icon>

Default elements: Root=div, Trigger=button, Positioner=div, Popup=div, Header=div, Title=div, Close=button, Content=div, Icon=span, Message=span, Footer=div.

Render Function Children#

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

<ConfirmDialog.Content>{(instance) => <div>{instance.confirmdialog?.state.open ? 'Open' : 'Closed'}</div>}</ConfirmDialog.Content>

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#

ConfirmDialogRoot#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogRootInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogRootInstance) => 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.
instanceConfirmDialogRootInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogRootPassThrough>—
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: ConfirmDialogRootInstance) => 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.
openboolean—
Specifies the visibility of the dialog.
defaultOpenboolean—
Specifies the default visibility of the dialog.
draggablebooleantrue
Enables dragging to change the position using header.
keepInViewportbooleantrue
Keeps dialog in the viewport.
trappedbooleantrue
When enabled, focus is trapped within the dialog (modal behavior).
dismissablebooleanfalse
Specifies if clicking the modal background should hide the dialog.
closeOnEscapebooleantrue
Specifies if pressing escape key should hide the dialog.
blockScrollbooleanfalse
Whether background scroll should be blocked when dialog is visible.
baseZIndexnumber0
Base zIndex value to use in layering.
autoZIndexbooleantrue
Whether to automatically manage layering.
appendTo"body" | HTMLElement | "self"body
A valid query selector or an HTMLElement to specify where the dialog gets attached.
position"center" | "top" | "bottom" | "left" | "right" | "topleft" | "topright" | "bottomleft" | "bottomright"center
Position of the dialog.
fullScreenbooleanfalse
Whether the dialog should open in full screen (maximized) mode.
onOpenChange(event: ConfirmDialogRootChangeEvent) => void—
Callback function that is called when the trigger is clicked.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-openPresent when the dialog is open
data-closedPresent when the dialog is closed

Defines passthrough(pt) options of ConfirmDialog component.

labeltypedescription
rootConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the root's DOM element.
backdropConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the backdrop's DOM element.
maskConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the mask's DOM element.
triggerConfirmDialogRootPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the trigger's DOM element.
triggerIconConfirmDialogRootPassThroughType<HTMLAttributes<HTMLElement>>Used to pass attributes to the trigger icon's DOM element.
headerConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the header's DOM element.
titleConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the title's DOM element.
headerActionsConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the headerActions's DOM element.
closeConfirmDialogRootPassThroughType<HTMLAttributes<HTMLButtonElement>>Used to pass attributes to the close's DOM element.
closeIconConfirmDialogRootPassThroughType<HTMLAttributes<HTMLElement>>Used to pass attributes to the close icon's DOM element.
contentConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the content's DOM element.
iconConfirmDialogRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the icon's DOM element.
messageConfirmDialogRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the message's DOM element.
footerConfirmDialogRootPassThroughType<HTMLAttributes<HTMLDivElement>>Used to pass attributes to the footer's DOM element.

ConfirmDialogTrigger#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogTriggerInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogTriggerInstance) => 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.
instanceConfirmDialogTriggerInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogTriggerPassThrough>—
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: ConfirmDialogTriggerInstance) => 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-openPresent when the dialog is open
data-closedPresent when the dialog is closed

Defines passthrough(pt) options of ConfirmDialogTrigger component.

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

ConfirmDialogPortal#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogPortalInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogPortalInstance) => 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.
instanceConfirmDialogPortalInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogPortalPassThrough>—
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: ConfirmDialogPortalInstance) => 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 ConfirmDialogPortal component.

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

ConfirmDialogBackdrop#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogBackdropInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogBackdropInstance) => 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.
instanceConfirmDialogBackdropInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogBackdropPassThrough>—
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: ConfirmDialogBackdropInstance) => 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.

Uses the Backdrop component internally for animated overlay rendering.

Defines passthrough(pt) options of ConfirmDialogBackdrop component.

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

ConfirmDialogPositioner#

AttributeValue
data-position"center" | "top" | "bottom" | "left" | "right" | "topleft" | "topright" | "bottomleft" | "bottomright"
data-scroll-behavior"inside" | "outside"
data-openPresent when the dialog is open
data-closedPresent when the dialog is closed

ConfirmDialogPopup#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogPopupInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogPopupInstance) => 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.
instanceConfirmDialogPopupInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogPopupPassThrough>—
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: ConfirmDialogPopupInstance) => 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-openPresent when the dialog is open

Uses VisuallyHidden elements internally for focus trap boundaries.

Defines passthrough(pt) options of ConfirmDialogPopup component.

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

ConfirmDialogHeader#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogHeaderInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogHeaderInstance) => 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.
instanceConfirmDialogHeaderInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogHeaderPassThrough>—
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: ConfirmDialogHeaderInstance) => 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 ConfirmDialogHeader component.

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

ConfirmDialogTitle#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogTitleInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogTitleInstance) => 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.
instanceConfirmDialogTitleInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogTitlePassThrough>—
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: ConfirmDialogTitleInstance) => 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 ConfirmDialogTitle component.

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

ConfirmDialogHeaderActions#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogHeaderActionsInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogHeaderActionsInstance) => 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.
instanceConfirmDialogHeaderActionsInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogHeaderActionsPassThrough>—
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: ConfirmDialogHeaderActionsInstance) => 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 ConfirmDialogHeaderActions component.

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

ConfirmDialogClose#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogCloseInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogCloseInstance) => 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.
instanceConfirmDialogCloseInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogClosePassThrough>—
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: ConfirmDialogCloseInstance) => 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.
iconOnlybooleantrue
Whether to show the ConfirmDialogClose with a borderless style.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"'secondary'
Severity type of the ConfirmDialogClose.
variant"link" | "text" | "outlined"'text'
Variant of the ConfirmDialogClose.
roundedbooleantrue
Whether to show the ConfirmDialogClose with a rounded style.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.

Defines passthrough(pt) options of ConfirmDialogClose component.

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

ConfirmDialogContent#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogContentInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogContentInstance) => 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.
instanceConfirmDialogContentInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogContentPassThrough>—
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: ConfirmDialogContentInstance) => 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 ConfirmDialogContent component.

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

ConfirmDialogIcon#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogIconInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogIconInstance) => 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.
instanceConfirmDialogIconInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogIconPassThrough>—
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: ConfirmDialogIconInstance) => 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 ConfirmDialogIcon component.

labeltypedescription
rootConfirmDialogIconPassThroughType<HTMLAttributes<HTMLLegendElement>>Used to pass attributes to the root's DOM element.

ConfirmDialogMessage#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogMessageInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogMessageInstance) => 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.
instanceConfirmDialogMessageInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogMessagePassThrough>—
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: ConfirmDialogMessageInstance) => 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 ConfirmDialogMessage component.

labeltypedescription
rootConfirmDialogMessagePassThroughType<HTMLAttributes<HTMLLegendElement>>Used to pass attributes to the root's DOM element.

ConfirmDialogFooter#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: ConfirmDialogFooterInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: ConfirmDialogFooterInstance) => 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.
instanceConfirmDialogFooterInstance—
The instance to pass to the component.
ptSafeRecord<ConfirmDialogFooterPassThrough>—
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: ConfirmDialogFooterInstance) => 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 ConfirmDialogFooter component.

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

Accessibility#

Screen Reader#

ConfirmDialog component uses dialog role along with aria-labelledby referring to the header element however any attribute is passed to the root element so aria-labelledby can be used to override this default behavior. In addition aria-modal is added since focus is kept within the popup.

Trigger element also has aria-expanded and aria-controls to indicate the dialog state.

Overlay Keyboard Support#

KeyFunction
tabMoves focus to the next the focusable element within the confirmdialog if modal is true. Otherwise, the focusable element in the page tab sequence.
shift + tabMoves focus to the previous the focusable element within the confirmdialog if modal is true. Otherwise, the focusable element in the page tab sequence.
escapeCloses the confirmdialog if closeOnEscape is true.

Close Button Keyboard Support#

KeyFunction
enterCloses the confirmdialog.
spaceCloses the confirmdialog.