Dialog
Dialogs display content in an overlay on top of the main page, blocking interaction with the background until closed.
Preview
Usage
tsx
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@e-infra/design-system'
<Dialog>
<DialogTrigger>Open Dialog</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Dialog Title</DialogTitle>
<DialogDescription>Dialog description here.</DialogDescription>
</DialogHeader>
<div>Dialog content</div>
<DialogFooter>
<Button>Cancel</Button>
<Button>Confirm</Button>
</DialogFooter>
</DialogContent>
</Dialog>Components
| Component | Description |
|---|---|
Dialog | Root container |
DialogTrigger | Element that opens dialog |
DialogContent | Dialog content wrapper |
DialogHeader | Header section container |
DialogFooter | Footer section container |
DialogTitle | Dialog title |
DialogDescription | Dialog description |
DialogClose | Close button |
DialogPortal | Portal wrapper |
DialogOverlay | Overlay backdrop |
Props
DialogTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Render as child component |
| ...props | React.HTMLAttributes | - | Native element props |
DialogContent
| Prop | Type | Default | Description |
|---|---|---|---|
| showCloseButton | boolean | true | Show close button |
| className | string | - | Additional CSS classes |
| ...props | React.ComponentProps | - | Radix UI Content props |