Dialog

A modal dialog component using the native HTML dialog element for accessibility and performance.

Edit Profile

Update your display name and email address.

Installation

CLI

Install the component using the StarUI CLI:

star add dialog

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.

Are you absolutely sure?

This action cannot be undone. This will permanently delete your account and remove your data from our servers.

All projects, files, and collaborator access will be permanently removed.

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.

Terms of Service

Please review our terms before continuing

1. Acceptance of Terms

By accessing and using this service, you accept and agree to be bound by these terms.

2. Use License

Permission is granted to temporarily download one copy of the materials for personal, non-commercial viewing only.

3. Disclaimer

Materials are provided on an 'as is' basis with no warranties, expressed or implied.

4. Limitations

In no event shall we be liable for any damages arising from the use or inability to use our service.

5. Privacy

Our privacy policy explains how we collect, use, and protect your data.

6. Termination

We reserve the right to terminate accounts that violate these terms.

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)].

Small

Compact confirmations and brief messages.

Medium

Standard forms and notifications.

Large

Multi-section forms and detailed content.

Extra Large

Data tables, comparisons, or complex layouts.

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.

Non-Modal Dialog

No backdrop, no focus trap — the page behind stays fully interactive.

Try clicking outside this dialog. It stays open without blocking the page.

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.

Signal-Controlled

Opened programmatically without a DialogTrigger.

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