Skip to content
Preview
Try a confirmation

ConfirmDialog

open
boolean
defaultOpen
boolean
Default: false
onOpenChange
(open: boolean) => void
onOpenChangeComplete
(open: boolean) => void
Called after the close animation.
onConfirm
() => unknown
Runs on confirm. A returned promise shows the loading state; a rejection keeps the dialog open and shows its message, or the confirm label's action ("Couldn't delete chat.") when it says nothing. The dialog closes when it resolves.
onCancel
() => void
loading
boolean
Controlled loading state (overrides the async one).
error
ReactNode
Controlled error message (overrides a caught rejection).
modal
boolean
Default: true
false for inline previews.
initialFocus
ComponentProps<typeof DialogContent>["initialFocus"]
Override the initial focus (default: the confirm button, in either tone; false leaves focus where it is, for inline previews).
container
PortalContainer
Default: document.body
Portal container.
titlerequired
ReactNode
description
ReactNode
confirmLabelrequired
string
A verb and its object: "Delete chat", "Discard changes".
cancelLabel
string
Default: "Cancel"
tone
"neutral" | "danger"
Default: "neutral"
confirmProps
ButtonMarks
The product's own marks on the confirm button: its data-* only.
cancelProps
ButtonMarks
The product's own marks on Cancel: its data-* only.
children
ReactNode
Extra content between the description and the actions (a "don't ask again" switch).

titlerequired
ReactNode
description
ReactNode
confirmLabelrequired
string
A verb and its object: "Delete chat", "Discard changes".
cancelLabel
string
Default: "Cancel"
tone
"neutral" | "danger"
Default: "neutral"
confirmProps
ButtonMarks
The product's own marks on the confirm button: its data-* only.
cancelProps
ButtonMarks
The product's own marks on Cancel: its data-* only.

State machine

PreviewConfirm the deployment or cancel.