Dialog
A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
Installation
npx neobrutal add dialog
Usage
import {Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger,} from "@/components/ui/dialog"
<Dialog><DialogTrigger render={<Button variant="neutral" />}>Open Dialog</DialogTrigger><DialogContent><DialogHeader><DialogTitle>Are you absolutely sure?</DialogTitle><DialogDescription>This action cannot be undone. This will permanently delete your accountand remove your data from our servers.</DialogDescription></DialogHeader></DialogContent></Dialog>
Props
Dialog
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | - | The controlled open state of the dialog. |
| defaultOpen | boolean | - | The default open state when uncontrolled. |
| onOpenChange | (open: boolean) => void | - | Event handler called when the open state changes. |
| modal | boolean | - | The modality of the dialog. When set to true, interaction with outside elements will be disabled. |