# Blazor Window Overview

This article provides basic information about the <a href="https://www.telerik.com/blazor-ui/window" target="_blank">Blazor Window component</a> and its core features.

The Window component displays a popup with a title bar and shows custom content. The component provides predefined title bar actions, such as Close, Minimize, Maximize, and Restore. The Window component also supports custom actions, modality, resizing, dragging, and position control.

## Creating Blazor Window

1. Use the `TelerikWindow` tag.
2. Bind the `Visible` parameter to a `bool` property. It supports one-way and two-way binding.
3. Add content to the `WindowContent` child tag.
4. (optional) Add some title inside a `WindowTitle` tag. HTML markup and child components are supported, too.
5. (optional) Add a [`Close` action](https://www.telerik.com/blazor-ui/documentation/components/window/actions) inside a `<WindowActions>` tag.
6. (optional) Add a `WindowFooter` tag to include custom content in the bottom section of the Window.

> caption Basic Blazor Window

<demo metaUrl="client/window/overview/" height="420"></demo>

## Size

The Window can occupy a predefined size on the screen or expand automatically based on the content. By default, users can resize the Window. [Read more about the Blazor Window size...](https://www.telerik.com/blazor-ui/documentation/components/window/size)

You can make the Window component responsive and allow it to adapt to different screen sizes and changes in the browser window. Here is an [example that shows the two possible ways to achieve responsive Window behavior](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-responsive). The first method involves utilizing the `Width` and `Height` parameters of the component. The second method is to apply custom CSS styles.

## Position

You can set the position of the Window with the `Top` and `Left` parameters. The Window component also provides a `ContainmentSelector` parameter that can limit resizing and dragging within the boundaries of a specified container.

Read more about the [Blazor Window position...](https://www.telerik.com/blazor-ui/documentation/components/window/position)

## Actions

You can maximize, minimize, or close the Window through the action buttons in its titlebar. [Read more about the Blazor Window action buttons...](https://www.telerik.com/blazor-ui/documentation/components/window/actions)

## Animations

You can set the animation of the Window with the `AnimationType` parameter. Read more about the [Blazor Window animations...](https://www.telerik.com/blazor-ui/documentation/components/window/animation)

## Dragging

You can move the Window on the page by dragging its titlebar. [Read more about the Blazor Window dragging option...](https://www.telerik.com/blazor-ui/documentation/components/window/draggable)

## Modal

The Window can be modal and prevent interacting with the rest of the page until it closes. [Read more about the Blazor Window Modal...](https://www.telerik.com/blazor-ui/documentation/components/window/modal)

## Events

The Window component fires events for visibility, state, size, and position changes. Use these events to respond to user actions. [Read more about the Blazor Window Events...](https://www.telerik.com/blazor-ui/documentation/components/window/events)

## Window Parameters

The following table lists the Window parameters. Also check the [Window API](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikwindow) for a full list of parameters, methods, and events.

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

| Parameter             | Type and Default Value                                                                                                                          | Description                                                                                                                                                                                                                                                                                                                     |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Class`               | `string`                                                                                                                                        | The custom CSS class of the `<div class="k-window">` element. Use it to [override theme styles](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/override-theme-styles). Here is a [custom Window styling example](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-custom-css-styling). |
| `CloseOnOverlayClick` | `bool`                                                                                                                                          | Sets if a modal Window will close when the user clicks on the modal overlay that covers the rest of the page content.                                                                                                                                                                                                           |
| `ContainmentSelector` | `string`                                                                                                                                        | A CSS selector that points to a unique HTML element on the page. The Window will render inside the specified container. Window resizing and dragging will be restricted by the boundaries of the specified container. Do not use `ContainmentSelector` with modal Windows.                                                      |
| `Draggable`           | `bool`                                                                                                                                          | Sets if the Window allows moving.                                                                                                                                                                                                                                                                                               |
| `FooterLayoutAlign`   | [`WindowFooterLayoutAlign`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.windowfooterlayoutalign) enum <br /> (`Stretch`) | The alignment of the HTML elements in the `WindowFooter`. The possible options are `Stretch`, `Start`, `End`, and `Center`.                                                                                                                                                                                                     |
| `Height`              | `string`                                                                                                                                        | The `height` style of the `<div class="k-window">` element. The parameter supports two-way binding.                                                                                                                                                                                                                             |
| `Id`                  | `string`                                                                                                                                        | The `id` attribute of the `<div class="k-window">` element.                                                                                                                                                                                                                                                                     |
| `Left`                | `string`                                                                                                                                        | The `left` style of the Window relative to the browser viewport. The parameter supports two-way binding. If `ContainmentSelector` is set, the left position is with regard to the defined container.                                                                                                                            |
| `MaxHeight`           | `string`                                                                                                                                        | The maximum height of the Window during resizing or initial display. For example, if there is a lot of content and a fixed `Height` is not set.                                                                                                                                                                                 |
| `MaxWidth`            | `string`                                                                                                                                        | The maximum width of the Window during resizing or initial display. For example, if there is a lot of content and a fixed `Width` is not set.                                                                                                                                                                                   |
| `MinHeight`           | `string`                                                                                                                                        | The minimum height of the Window during resizing or initial display.                                                                                                                                                                                                                                                            |
| `MinWidth`            | `string`                                                                                                                                        | The maximum width of the Window during resizing or initial display.                                                                                                                                                                                                                                                             |
| `Modal`               | `bool`                                                                                                                                          | Determines if the Window covers the other page content with a semi-transparent overlay. Do not use modality with `ContainmentSelector`.                                                                                                                                                                                         |
| `PersistContent`      | `bool`                                                                                                                                          | Determines if a [minimized Window](https://www.telerik.com/blazor-ui/documentation/components/window/size#maximize-and-minimize) removes its content from the DOM (default) or hides it with CSS.                                                                                                                               |
| `Resizable`           | `bool` <br /> (`true`)                                                                                                                          | Determines if the Window allows users to change its dimensions.                                                                                                                                                                                                                                                                 |
| `Size`                | `string`                                                                                                                                        | A predefined Window width. Use the string members of the static class `ThemeConstants.Window.Size` - `Small`, `Medium`, and `Large`. They translate to widths of `300px`, `800px` and `1200px`, respectively. If set, the `Width` parameter will take precedence over `Size`.                                                   |
| `State`               | `WindowState` enum <br /> (`Default`)                                                                                                           | The Window state can be `Maximized`, `Minimized`, or `Default`. The parameter supports two-way binding.                                                                                                                                                                                                                         |
| `Top`                 | `string`                                                                                                                                        | The `top` style of the Window relative to the browser viewport. The parameter supports two-way binding. If `ContainmentSelector` is set, the top position is with regard to the defined container.                                                                                                                              |
| `Visible`             | `bool`                                                                                                                                          | Defines if the Window is rendered and visible on the page. The parameter supports two-way binding.                                                                                                                                                                                                                              |
| `Width`               | `string`                                                                                                                                        | The `width` style of the `<div class="k-window">` element. The parameter supports two-way binding.                                                                                                                                                                                                                              |

## Window Reference and Methods

The Window methods are accessible through its reference.

| Method    | Description            |
| --------- | ---------------------- |
| `Refresh` | Redraws the component. |

> caption Get a reference to the Window and use its Refresh method.

<demo metaUrl="client/window/overview/example-1/" height="420"></demo>

## Important Notes

When [`ContainmentSelector`](https://www.telerik.com/blazor-ui/documentation/components/window/position#containmentselector) is not set, the Telerik Window component renders as a child of the [`TelerikRootComponent`](https://www.telerik.com/blazor-ui/documentation/components/rootcomponent/overview) at the root of the Blazor app. This placement ensures that the Window can show over all the other page content in all scenarios and have a correct position.

In Blazor, however, the render tree structure may be important. In some cases, the special Window placement may put you in one of the following situations:

* [Block all content with a Window](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-block-all-content)
* [CascadingParameter Value is null in the Window](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-cascading-parameter-null)
* [The Window does not display its child items data](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-does-not-display-child-items-data)
* [Returning data from a Window does not update the parent](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-does-not-update-parent)
* [Using an EditContext for a form holding a Window requires updating the EditContext](https://www.telerik.com/blazor-ui/documentation/knowledge-base/window-in-form-edit-context)

## Next Steps

* [Define Window actions](https://www.telerik.com/blazor-ui/documentation/components/window/actions)
* [Configure the Window position](https://www.telerik.com/blazor-ui/documentation/components/window/position)
* [Set the Window size, minimized, and maximized state](https://www.telerik.com/blazor-ui/documentation/components/window/size)
* [Handle Window events](https://www.telerik.com/blazor-ui/documentation/components/window/events)

## See Also

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