-

Confirm Dialog

PreviousNext

A focused confirmation dialog for destructive, warning, and irreversible ZGI workspace actions.

Installation

pnpm dlx shadcn@latest add https://ui.zgi.ai/r/confirm-dialog.json

Usage

import { ConfirmDialog } from "@/components/ui/confirm-dialog"
<ConfirmDialog
  variant="danger"
  title="Delete workflow draft?"
  description="This removes the local draft from the workspace."
  confirmText="Delete draft"
  cancelText="Keep draft"
  onConfirm={() => deleteDraft()}
  trigger={<Button variant="outline">Delete draft</Button>}
/>

API Reference

PropTypeDescription
triggerReactNodeOptional element that opens the dialog
titleReactNodeDialog title
descriptionReactNodeSupporting confirmation copy
confirmTextstringConfirm button label
cancelTextstringCancel button label
onConfirm() => void | Promise<void>Runs when the user confirms
loadingbooleanControlled loading state
openbooleanControlled open state
onOpenChange(open: boolean) => voidControlled open handler
variant"default" | "warning" | "danger"Action severity