# Dialog > Compound modal dialog overlay for displaying content that requires user attention. Source: https://shellui.dev/docs/v0.3/components/layout/dialog ## Overview The Dialog component is a compound component that provides a modal overlay for forms, confirmations, and important content. It uses `CascadingParameter` to share open state between sub-components and `Shell.Cn()` for class merging. ## Installation ```bash shellui add dialog ``` ## Usage ### Basic Dialog ```razor Dialog Title This is a description of the dialog.

Your content goes here.

@code { private bool isOpen = false; private void HandleSave() { isOpen = false; } } ``` ### Confirmation Dialog ```razor Are you sure? This action cannot be undone. @code { private bool showConfirm = false; private void HandleDelete() { showConfirm = false; } } ``` ### Form Dialog ```razor Add New User Enter the user details below.
@code { private bool isOpen = false; private string name = ""; private string email = ""; private void HandleSubmit() { isOpen = false; } } ``` ## API Reference ### Dialog | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `Open` | `bool` | `false` | Controls the dialog open state | | `OpenChanged` | `EventCallback` | — | Callback when open state changes | | `ChildContent` | `RenderFragment` | — | Dialog sub-components | ### DialogTrigger | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `ChildContent` | `RenderFragment` | — | Element that opens the dialog on click | ### DialogContent | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `ChildContent` | `RenderFragment` | — | Modal body content | | `Class` | `string?` | `null` | Additional CSS classes | ### DialogHeader / DialogFooter | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `ChildContent` | `RenderFragment` | — | Section content | | `Class` | `string?` | `null` | Additional CSS classes | ### DialogTitle / DialogDescription | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `ChildContent` | `RenderFragment` | — | Text content | | `Class` | `string?` | `null` | Additional CSS classes | ### DialogClose | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `ChildContent` | `RenderFragment` | — | Element that closes the dialog on click | ## Accessibility - Focus is trapped inside the dialog while open. - Pressing Escape closes the dialog. - Proper `role="dialog"` and `aria-labelledby` / `aria-describedby` attributes are applied. - Focus returns to the trigger element when the dialog closes.