Dialog

A modal window overlaid on the page with an optional close button.

The Dialog overlays content on the page. Compose it from Dialog, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, and DialogClose.

Preview

Usage

Installation

$ npx shadcn@latest add https://spark-ui-olive.vercel.app/r/dialog.json

Properties

PropTypeDefaultDescription
showCloseButtonbooleantrueDialogContent only: show the corner close button.
openbooleanControlled open state of the dialog.
onOpenChange(open: boolean) => voidCalled when the open state changes.
classNamestringAdditional CSS classes. Available on every subcomponent.