ReferenceComponentsDialogs, toasts, and overlays
ConfirmDialog
ConfirmDialog component API, behavior, and executable example.
Loading executable example…
API and events
Layer focus-trapped dialogs, contextual help, transient notices, and searchable command execution over an application.
export function ConfirmDialog({
title,
description,
confirmLabel,
cancelLabel,
danger,
onConfirm,
onCancel,
trigger,
...dialogProps
}: ConfirmDialogProps): ReactNode;Props, functions, and events
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
title | string | Yes | The title member uses the string contract. | — |
description | string | undefined | No | The description member uses the string | undefined contract. | — |
confirmLabel | string | undefined | No | The confirmLabel member uses the string | undefined contract. | — |
cancelLabel | string | undefined | No | The cancelLabel member uses the string | undefined contract. | — |
danger | boolean | undefined | No | The danger member uses the boolean | undefined contract. | — |
onConfirm | () => void | Promise<void> | Yes | The onConfirm member uses the () => void | Promise<void> contract. | — |
onCancel | (() => void | Promise<void>) | undefined | No | The onCancel member uses the (() => void | Promise<void>) | undefined contract. | — |
trigger | ReactNode | No | The trigger member uses the ReactNode contract. | — |
id | string | undefined | No | The id member uses the string | undefined contract. | — |
open | boolean | undefined | No | The open member uses the boolean | undefined contract. | — |
defaultOpen | boolean | undefined | No | The defaultOpen member uses the boolean | undefined contract. | — |
onOpenChange | ((open: boolean) => void | Promise<void>) | undefined | No | The onOpenChange member uses the ((open: boolean) => void | Promise<void>) | undefined contract. | — |
Open state and selections flow through onOpenChange, onPress, command callbacks, and the toast API.
Callback props run after the documented input is accepted. Callbacks are not cancellable unless their return type or description states otherwise.
Interaction and capabilities
The top overlay receives input before application hotkeys. Escape closes dismissible overlays and focus returns to the prior node.
The published manifest records keyboard, focus, pointer, theme, terminal, semantic, event, and dependency requirements.
Complete import
import { ConfirmDialog } from "@/components/tuil/feedback/overlays";