Installation
Usage
Component API
Dialog
The root dialog component built on Radix UI. Props:open- Control dialog open stateonOpenChange- Callback when open state changesdefaultOpen- Initial open statemodal- Whether dialog is modal (default:true)
DialogTrigger
The element that opens the dialog. Props:asChild- Compose with child element
DialogContent
The dialog content container. Props:showCloseButton- Show close button (default:true)onEscapeKeyDown- Callback when escape is pressedonPointerDownOutside- Callback when clicking outside
DialogHeader
Container for title and description.DialogTitle
The dialog title (required for accessibility).DialogDescription
The dialog description.DialogFooter
Container for dialog actions. Props:showCloseButton- Show close button (default:false)
DialogClose
Closes the dialog.Examples
Custom Close Button
Replace the default close control with your own button:No Close Button
Hide the close button completely:Scrollable Content
Long content can scroll while the header stays in view:Sticky Footer
Keep actions visible while the content scrolls:Controlled Dialog
Control the dialog open state:Form Dialog
Dialog containing a form:Accessibility
- Built on Radix UI for full accessibility
- Focus is trapped within the dialog
- Escape key closes the dialog
- Background content is inert
- Screen reader compatible
- ARIA labels and roles