# Blazor Dialog Overview

The <a href="https://www.telerik.com/blazor-ui/dialog" target="_blank">Blazor Dialog component</a> is a modal popup that brings information to the user. It provides actions through its action buttons to prompt the user for input or to ask for a decision. The component can also contain more complex UI elements that require the attention of the user.

The Dialog component and its [predefined options](https://www.telerik.com/blazor-ui/documentation/components/dialog/predefined) aim to deliver user experience similar to default browser dialogs. For more functionalities such as drag and resize, use the [Window](https://www.telerik.com/blazor-ui/documentation/components/window/overview) component.

## Creating Blazor Dialog

1. Add the `TelerikDialog` tag to a Razor file.

2. Set the `Visible` parameter to a `bool` object. It supports one-way and two-way binding.

3. Set the `Title` property to a `string` object.

4. Set the Dialog content through the `DialogContent` RenderFragment parameter

5. (optional) Configure the [`DialogButtons`](https://www.telerik.com/blazor-ui/documentation/components/dialog/action-buttons) inside the `TelerikDialog` tag.

> caption A basic configuration of the Telerik Dialog.

<demo metaUrl="client/dialog/overview/" height="400"></demo>

## Predefined Dialogs

Predefined Dialogs are styled substitutes to the standard browser dialogs - confirm, alert and prompt. [Read more about the Blazor Predefined Dialogs](https://www.telerik.com/blazor-ui/documentation/components/dialog/predefined).

## Header

The Dialog allows header customization and gives the option to toggle the close button. [Read more about the Dialog Header](https://www.telerik.com/blazor-ui/documentation/components/dialog/header).

## Action Buttons

The Dialog provides options for rendering action buttons and customizing their text and layout. [Read more about the Dialog Action Buttons](https://www.telerik.com/blazor-ui/documentation/components/dialog/action-buttons).

## Events

The Blazor Dialog fires a `VisibleChanged` event to customize the application behavior and respond to user actions. [Read more about the Blazor Dialog events](https://www.telerik.com/blazor-ui/documentation/components/dialog/events).

## Dialog Parameters

The Blazor Dialog provides various parameters to configure the component. Also check the [Dialog public API](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikdialog).

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter                | Type and Default Value                        | Description                                                                                                                                                                      |
| ------------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ButtonsLayout`          | `DialogButtonsLayout` enum <br /> (`Stretch`) | The layout of the actions button in the footer. See more in the [Action Buttons article](https://www.telerik.com/blazor-ui/documentation/components/dialog/action-buttons)).     |
| `Class`                  | `string`                                      | A custom CSS class to the `<div class="k-window k-dialog">` element.                                                                                                             |
| `CloseOnOverlayClick`    | `bool`                                        | Defines if clicking on the modal overlay should close the Dialog.                                                                                                                |
| `FocusedElementSelector` | `string`                                      | The CSS selector of the initially focused item on open. By default, it is the first focusable item in the Dialog.                                                                |
| `Height`                 | `string`                                      | The height of the Dialog in any [supported CSS unit](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions).                                                |
| `ShowCloseButton`        | `bool` <br /> (`true`)                        | Defines if the component will render a Close button in the titlebar. See more in the [Header article](https://www.telerik.com/blazor-ui/documentation/components/dialog/header). |
| `Title`                  | `string`                                      | The Dialog title.                                                                                                                                                                |
| `Visible`                | `bool`                                        | Defines the Dialog visibility.                                                                                                                                                   |
| `Width`                  | `string`                                      | The width of the Dialog in any [supported CSS unit](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions).                                                 |

## Dialog Reference and Methods

The Dialog methods are accessible through its reference.

| Method    | Description                                                                                                                                                                                                                                                                                                                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Refresh` | Re-renders the Dialog. <br /> The Dialog is rendered as a child of the [`TelerikRootComponent`](https://www.telerik.com/blazor-ui/documentation/components/rootcomponent/overview), instead of where it is declared. As a result, it doesn't automatically refresh when its content is updated. In such cases, the `Refresh` method comes in handy to ensure that the Dialog content is up-to-date. |

> caption Get a reference to the Dialog and use its methods.

<demo metaUrl="client/dialog/methods/" height="420"></demo>

## Next Steps

* [Customize the Dialog Header](https://www.telerik.com/blazor-ui/documentation/components/dialog/header)

* [Customize the Dialog Action Buttons](https://www.telerik.com/blazor-ui/documentation/components/dialog/action-buttons)

* [Explore the Predefined Dialogs](https://www.telerik.com/blazor-ui/documentation/components/dialog/predefined)

* [Handle the Dialog Events](https://www.telerik.com/blazor-ui/documentation/components/dialog/events)

## See Also

* [Live Dialog Demos](https://demos.telerik.com/blazor-ui/dialog/overview)
* [Dialog API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikdialog)
* [Comparison between All Popup Components](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-popup-component-comparison)
