Aliases
modal
DialogModal dialog with focus containment and configurable dismissal.
Aliases
modal
Foundations
Dialog for blocking confirmations, brief forms, or focused review tasks.Dialog for passive status messages; use Alert or Toast.Drawer for supporting tasks that need more page context.open control
trigger Control that opens the dialog.
modal container
surface Contains title, description, body, and footer.
actions row
footer Optional closing actions area.
| Name | Type | Default | Description |
|---|---|---|---|
open | boolean | false | Controlled open state. |
size | 'sm' | 'md' | 'lg' | 'md' | Chooses the dialog size recipe. |
title | string | — | Dialog title. |
description | string | — | Optional supporting explanation. |
closeOnEscape | boolean | true | Allows Escape to close the dialog. |
closeOnOutsidePress | boolean | true | Allows outside press dismissal. |
onOpenChange | (detail: { open: boolean }) => void | — | Runs when the dialog opens or closes. |
theme | ThemeContract | — | Sets the theme used to resolve component styles. |
| Name | Payload | Description |
|---|---|---|
openchange | { open: boolean } | Fires when an overlay-style component opens or closes through user interaction. |
| Name | Description |
|---|---|
trigger | Optional trigger content. |
default | Dialog body content. |
footer | Optional footer actions. |
Variants
modal: Centered blocking overlay surface.Sizes
sm: Compact modalmd: Default modallg: Larger modal for more contentStates
closed: Dialog is hiddenopen: Dialog is visible and focus-containedSemantics
Keyboard
Screen readers
Checklist
Implementation notes
Dialog is modal. Use Popover for contextual content that does not block the page.A dialog for reviewing a decision.
<Dialog title="Release notes" description="Confirm the publication details before shipping."><svelte:fragment slot="trigger">Open dialog</svelte:fragment>Review the release details.</Dialog> Use a footer when the decision needs multiple clear next steps.
<Dialog title="Confirm delete"><svelte:fragment slot="footer"><Button variant="ghost">Cancel</Button><Button variant="destructive">Delete</Button></svelte:fragment>Review the consequences before continuing.</Dialog> Control open state when product logic owns the workflow.
<Dialog open={isOpen} onOpenChange={(detail) => isOpen = detail.open} title="Release notes">Review details</Dialog> Calculated fixtures; browser evidence is not collected. Layout estimates use declared text behavior and maximum token values.
size=sm
size=md
size=lg