Get started
Fabricator UI

Search documentation

Search pages, components, blocks, styles and colours.

Dialog

PreviousNext

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Installation

bunx --bun fabricator-ui@latest add dialog

Usage

import { Button } from "@/components/ui/button"
import {
  Dialog,
  DialogDescription,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
<DialogTrigger>
  <Button>Open</Button>
  <Dialog>
    <DialogHeader>
      <DialogTitle>Are you absolutely sure?</DialogTitle>
      <DialogDescription>
        This action cannot be undone. This will permanently delete your account
        and remove your data from our servers.
      </DialogDescription>
    </DialogHeader>
  </Dialog>
</DialogTrigger>

Composition

Use the following composition to build a Dialog:

DialogTrigger
├── Button
└── Dialog
    ├── DialogHeader
    │   ├── DialogTitle
    │   └── DialogDescription
    └── DialogFooter

Custom Close Button

Replace the default close control with your own button.

No Close Button

Use showCloseButton={false} to hide the close button.

Keep actions visible while the content scrolls.

Scrollable Content

Long content can scroll while the header stays in view.

API Reference

See the React Aria documentation for more information.