Dialog
View on shadcn/uiA modal window that overlays the main content and requires user interaction.
Installation
pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/dialog.jsonUsage
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";<Dialog>
<DialogTrigger>Open dialog</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Dialog title</DialogTitle>
<DialogDescription>
This is a description of the dialog content.
</DialogDescription>
</DialogHeader>
<div>Your content goes here</div>
<DialogFooter>
<Button>Save</Button>
</DialogFooter>
</DialogContent>
</Dialog>Examples
API reference
This component is built on top of Radix UI Dialog. For additional props and detailed API documentation, refer to the Radix documentation.