# Dialog > A modal window over the page, with a backdrop. Source: https://native.shellui.dev/docs/components/overlay/dialog Declare it anywhere, next to the button that opens it: the content covers the window while it's open. Escape, the backdrop, the close button or any `DialogClose` closes it. While it's open, keyboard focus stays inside. ## Installation ```bash shellui-native add dialog ``` **Platforms:** MAUI · Avalonia. Also installs `dialog-trigger`, `dialog-content`, `dialog-header`, `dialog-footer`, `dialog-title`, `dialog-description`, `dialog-close`, `element-extensions`, `icon`. ## Usage ### Basic **MAUI** ```xml ``` **Avalonia** ```xml ``` [Live preview](https://native.shellui.dev/preview/index.html?c=dialog-basic) ## From code ```csharp ProfileDialog.SetOpen(true); ProfileDialog.OpenChanged += (_, open) => Status.Text = open ? "Editing" : "Closed"; ``` ## MAUI and Avalonia On Avalonia the XAML children of `Dialog` and `DialogContent` are collected in `Items`. Otherwise the same. ## API ### Dialog XAML children go to `Items` on Avalonia. | Property | Type | Default | Description | |---|---|---|---| | `Open` | `bool` | `false` | Whether it's open. Two-way bindable. | | Event | Arguments | Description | |---|---|---| | `OpenChanged` | `bool` | Opened or closed. | | Method | Description | |---|---| | `SetOpen(bool value)` | Opens or closes it. | ### DialogTrigger | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. | ### DialogContent XAML children go to `Items` on Avalonia and `Children` on MAUI. | Property | Type | Default | Description | |---|---|---|---| | `ShowCloseButton` | `bool` | `true` | Shows the close button in the corner. | ### DialogHeader XAML children go to `Children`. No properties of its own. ### DialogTitle | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | ### DialogDescription | Property | Type | Default | Description | |---|---|---|---| | `Text` | `string` | — | Text shown by the component. | ### DialogFooter XAML children go to `Children`. No properties of its own. ### DialogClose | Method | Description | |---|---| | `Activate()` | Does what pressing it does. | | `ShellTriggerView.ActivateAncestor(Element from)` | Called by interactive children (Button) after they handle a click. |