Dialog

A window over the page, with a header, content and footer.

Example

tsx
<Dialog>
  <DialogTrigger>Open dialog</DialogTrigger>
  <DialogBody size="sm">
    <DialogHeader>
      <DialogTitle>Publish changes</DialogTitle>
    </DialogHeader>
    <DialogContent>
      <DialogDescription>
        Visitors see the new version as soon as it is published.
      </DialogDescription>
    </DialogContent>
    <DialogFooter>
      <DialogClose>Close</DialogClose>
    </DialogFooter>
  </DialogBody>
</Dialog>

Usage

Pages are built on the server: import the tags from @dash/server and return the tree. The browser runtime draws it.
tsx
import { Dialog, DialogTrigger, DialogBody, DialogHeader, DialogTitle, DialogContent, DialogDescription, DialogFooter, DialogClose } from "@dash/server";

Props

DialogProps

Prop
Type
Description
defaultOpenboolean
openboolean
onOpenChange(open: boolean) => void

DialogBodyProps

Prop
Type
Description
size"sm" | "md" | "lg"
On this page