Confirm Dialog

A confirmation dialog for important or destructive actions.

v0

Installation

Full Setup guide

Install the component automatically via Shadcn CLI.

npx shadcn@latest add https://www.grettech.com/api/registry/confirm-dialog

Other Examples

Default Variant

v0

Props

PropTypeDefaultDescription
title
string"Are you absolutely sure?"Dialog title.
description
string"This action cannot be undone. This will permanently delete your account and remove your data from our servers."Text under the title.
triggerText
string"Open Dialog"Label of the default trigger button, used when children is not set.
confirmText
string"Continue"Label of the confirm button.
cancelText
string"Cancel"Label of the cancel button.
variant
"default" | "destructive""default"Style of the confirm button (and the default trigger).
onConfirm
() => void | Promise<void>-Called when the user confirms. If it returns a promise, the dialog shows a loading state and stays open until it settles.
children
React.ReactNode-Trigger element. It receives onClick, so pass a button or a component that forwards onClick. Plain text is wrapped in a Button; without children, a Button with triggerText is used.
className
string-Extra classes for the dialog content.
...props
React.HTMLAttributes<HTMLDivElement>-Any other attributes (id, style, aria-*, etc.), passed to the dialog content.