"use client";
import { ConfirmDialog } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
onConfirm (required) | () => void | — | Called on Confirm; the dialog then closes. |
title | ReactNode | — | Title, wired to aria-labelledby automatically. |
trigger | ReactElement | — | Element that toggles the dialog (gets aria-expanded/aria-controls). |
backdropProps | HTMLAttributes<HTMLDivElement> | — | Props for the backdrop / positioning layer behind the surface. |
cancelLabel | string | — | — |
closeLabel | string | from the message catalog | Accessible name of the close button (default from the message catalog). |
confirmLabel | string | — | — |
confirmTone | "primary" | "danger" | — | — |
container | Element | DocumentFragment | null | document.body | Portal container (default document.body). |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
onConfirmrequired() => void
Called on Confirm; the dialog then closes.
titleReactNode
Title, wired to aria-labelledby automatically.
triggerReactElement
Element that toggles the dialog (gets aria-expanded/aria-controls).
backdropPropsHTMLAttributes<HTMLDivElement>
Props for the backdrop / positioning layer behind the surface.
cancelLabelstring
closeLabeldefault from the message catalogstring
Accessible name of the close button (default from the message catalog).
confirmLabelstring
confirmTone"primary" | "danger"
containerdefault document.bodyElement | DocumentFragment | null
Portal container (default document.body).
defaultOpenboolean
Initial open state when uncontrolled.
const remove = () => console.log("deleted");
<ConfirmDialog title="Delete file?" onConfirm={remove} trigger={<Button>Delete…</Button>} />