A modal dialog component using the native HTML dialog element for accessibility and performance.
Installation
CLI
Install the component using the StarUI CLI:
Examples
Confirmation
Destructive action with a warning and two exit paths. The delete button passes value='delete' to DialogClose so the close event carries the user's intent.
Scrollable Content
Long content in a scrollable container with a checkbox-gated accept button. Uses size='lg' for breathing room and data_attr_disabled to block acceptance until checked.
Sizes
Four width variants from compact (sm) to spacious (xl). All sizes cap at max-h-[85vh] and add horizontal margin on mobile via max-w-[calc(100%-2rem)].
Non-Modal
Set modal=False to skip the backdrop overlay and focus trap. The dialog stays open while users interact with the page — useful for persistent panels or side information.
Programmatic Control
Open a dialog via signal reference instead of DialogTrigger — useful for custom logic or external events. The open state is tracked reactively. show_close_button=False removes the corner X.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
signal |
str | Signal |
'' |
Signal ID for the dialog element ref and open state tracking |
modal |
bool |
True |
Whether the dialog blocks page interaction with a backdrop overlay |
size |
DialogSize |
'md' |
Width variant — 'sm', 'md', 'lg', 'xl', or 'full' |
| Component | Description |
|---|---|
DialogTrigger |
Button that opens the dialog on click |
DialogContent |
Content container with optional close button (show_close_button=True) |
DialogHeader |
Flex column for title and description |
DialogTitle |
Dialog heading rendered as H2 |
DialogDescription |
Muted supporting text below the title |
DialogFooter |
Right-aligned footer for action buttons |
DialogClose |
Button that closes the dialog, with optional return value |