Dialog

Modal window on Radix Dialog with a blurred backdrop, a flat card surface and an optional close button.

Installation

pnpm dlx shadcn@latest add @ward/dialog

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/dialog.json

Usage

import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
<Dialog>
  <DialogTrigger asChild><Button variant="outline">Rename</Button></DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Rename collection</DialogTitle>
      <DialogDescription>Members see the new name straight away.</DialogDescription>
    </DialogHeader>
    <DialogFooter showCloseButton>
      <Button>Save</Button>
    </DialogFooter>
  </DialogContent>
</Dialog>

Props

PropTypeDefaultDescription
openboolean-Whether the dialog is open, when the parent controls it.
defaultOpenbooleanfalseWhether the dialog starts open when it is uncontrolled.
onOpenChange(open: boolean) => void-Called when the dialog opens or closes.
modalbooleantrueBlock interaction with the rest of the page while the dialog is open.
DialogContent showCloseButtonbooleantrueShow the close button in the top corner.
DialogFooter showCloseButtonbooleanfalseAdd an outline Close button after the footer's children.
DialogTrigger asChildbooleanfalseUse the child element as the trigger instead of rendering a button.

Ward · Version 1.0.0 · Registry manifest