Dialog
Dialogs are overlays that focus the user's attention on a specific task or piece of information.
Installation
Add the dialog component to your project:
Usage
Basic Dialog
Dialog
Live preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Dialog
Full preview from the registry iframe.
Loading preview...
Compact Dialog
Dialog
smallLive preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Dialog
Full preview from the registry iframe.
Loading preview...
Large Dialog
Dialog
largeLive preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Dialog
Full preview from the registry iframe.
Loading preview...
Full-width Dialog
Dialog
fullscreenLive preview rendered from the registry in an isolated iframe.
Loading preview...
Failed to load preview
Dialog
Full preview from the registry iframe.
Loading preview...
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id |
string |
dialog |
Unique identifier for the dialog |
size |
string |
md |
Dialog size (sm, md, lg, xl, 2xl, 3xl, 4xl, full) |
closeable |
boolean |
true |
Show close button and allow closing |
title |
string |
null |
Dialog title |
footer |
slot |
null |
Dialog footer content |
Accessibility
Dialogs include:
- Focus trap - Tab cycles within the dialog
- Escape key - Closes modal when
closeableis true - Click outside - Closes modal when
closeableis true - ARIA attributes - Proper screen reader support
Keyboard Interactions
| Key | Action |
|---|---|
Escape |
Close dialog (when closeable) |
Tab |
Move focus within the dialog |
Shift + Tab |
Move focus backwards |
Next Steps
- Explore Button component
- Learn about Card component
- View Input component