Skip to content

ConfirmDialog

Shared Components

Pre-configured confirmation dialog for destructive actions with customizable title, message, and button labels.

Default confirmationDestructive confirmationResult feedback
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use for a short confirmation with a default or destructive action. onConfirm is synchronous and the dialog closes immediately. Use a controlled Dialog for asynchronous operations that must remain open on failure.

Import
import { ConfirmDialog } from "@dashboardpack/core/components/shared/confirm-dialog";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

ConfirmDialog props
PropType / DefaultDescription
openboolean

Default: required

Controlled visibility.
onOpenChange(open: boolean) => void

Default: required

Handle dismissal.
title / descriptionstring

Default: required

Action and its consequences.
confirmLabelstring

Default: Confirm

Confirmation button text.
variantdefault | destructive

Default: default

Confirmation action appearance.
onConfirm() => void

Default: required

Synchronous callback; closes immediately afterward.

Build with these too