Dialog

Installation

$npx shadcn-macos@latest add dialog

Examples

Props

<Dialog />
PropTypeDefaultDescription
open*boolean—Controls whether the dialog modal is visible.
onOpenChange*(open: boolean) => void—Callback invoked when modal is opened or dismissed.
title*string—Headline dialog message.
descriptionstring—Explanatory context under the title.
confirmTextstring"OK"Text for the primary confirm button.
cancelTextstring"Cancel"Text for the secondary cancel button.
destructivebooleanfalseWhether the confirm button uses destructive red styling.
onConfirm() => void—Callback invoked when confirm button is clicked.
onCancel() => void—Callback invoked when cancel button is clicked.