bearnie

Dialog

Modal overlay for confirmations and forms.

Installation

npx bearnie add dialog
npx bearnie add dialog

Usage

import {
Dialog,
DialogTrigger,
DialogOverlay,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
DialogFooter,
} from "@/components/ui/dialog"
<Dialog>
<DialogTrigger>
  <Button>Open</Button>
</DialogTrigger>
<DialogOverlay />
<DialogContent>
  <DialogHeader>
    <DialogTitle>Title</DialogTitle>
    <DialogDescription>Description</DialogDescription>
  </DialogHeader>
</DialogContent>
</Dialog>

Examples

With form

Anatomy

  • Dialog - The root container that manages state
  • DialogTrigger - The element that opens the dialog
  • DialogOverlay - The backdrop behind the dialog
  • DialogContent - The dialog panel with close button
  • DialogHeader - Container for title and description
  • DialogTitle - The dialog heading
  • DialogDescription - Secondary descriptive text
  • DialogFooter - Container for action buttons

Props

All Dialog components accept class for additional CSS classes. They are structural components without specific props.