# Blazor AnimationContainer Overview

The <a href="https://www.telerik.com/blazor-ui/animation-container" target="_blank">Blazor Animation Container component</a> enables you to create messages and popups or expandable containers. It lets you define its animation, size and position, and arbitrary content.

> tip The `AnimationContainer` animates and renders content in-place and does not have all the features of a true popup. [Compare the abilities of all Telerik Blazor popup components](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-popup-component-comparison) to verify if the [Popup](https://www.telerik.com/blazor-ui/documentation/components/popup/overview) or [Popover](https://www.telerik.com/blazor-ui/documentation/components/popover/overview) components are more suitable for your needs. If you are looking for an option to create [Notification](https://www.telerik.com/blazor-ui/documentation/components/notification/overview), [Tooltip](https://www.telerik.com/blazor-ui/documentation/components/tooltip/overview) or expandable container such as [Drawer](https://www.telerik.com/blazor-ui/documentation/components/drawer/overview), you may use the dedicated components.

## Creating Blazor AnimationContainer

1. Use the `TelerikAnimationContainer` tag.
2. Assign a [reference to the component instance via `@ref`](https://www.telerik.com/blazor-ui/documentation/components/animationcontainer/overview#animationcontainer-reference-and-methods).
3. Add content as `ChildContent` inside the `TelerikAnimationContainer` tag.
4. (optional) Define the [`AnimationType` or `AnimationDuration`](https://www.telerik.com/blazor-ui/documentation/components/animationcontainer/overview#animation).
5. (optional) Set [parameters](https://www.telerik.com/blazor-ui/documentation/components/animationcontainer/overview#animationcontainer-parameters) for dimensions or [position](https://www.telerik.com/blazor-ui/documentation/components/animationcontainer/overview#position).

> caption Basic AnimationContainer

<demo metaUrl="client/animationcontainer/basic/" height="420"></demo>

## Position

The Animation Container renders at the place of its declaration. It has a `position:absolute` CSS style, so it will display over adjacent elements. The component position can be offset by parent elements with a `position` style, even of the `Top` and `Left` parameters are set.

The component should reside outside elements with an `overflow` CSS style. Otherwise, it may be clipped or overlapped by other scrollable containers. This limitation does not exist for the [Popup](https://www.telerik.com/blazor-ui/documentation/components/popup/overview) and [Popover](https://www.telerik.com/blazor-ui/documentation/components/popover/overview) components.

## Animation

One of the core features of the Animation Container is the customizable open and close animation type and animation duration. Set the `AnimationDuration` parameter in milliseconds as `int`. The possible `AnimationType` values are the members of the `AnimationType` enum:

* `None`
* `Fade`
* `PushUp`
* `PushDown`
* `PushLeft`
* `PushRight`
* `RevealVertical`
* `SlideUp`
* `SlideIn`
* `SlideDown` (default)
* `SlideRight`
* `SlideLeft`
* `ZoomIn`
* `ZoomOut`

> caption AnimationContainer animation options

<demo metaUrl="client/animationcontainer/animation/" height="420"></demo>

## AnimationContainer Parameters

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

| Parameter           | Type and Default Value                    | Description                                                                                                                                                                                 |
| ------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AnimationDuration` | `int` <br /> (`300`)                      | The length of the opening and closing animations.                                                                                                                                           |
| `AnimationType`     | `AnimationType` enum <br /> (`SlideDown`) | The [animation type (fade, slide, push, zoom, etc.)](https://www.telerik.com/blazor-ui/documentation/components/animationcontainer/overview#animation).                                     |
| `Class`             | `string`                                  | The custom CSS class to be rendered on the `<div>` element, which wraps the component `ChildContent`. This is *not* the outermost component container. See `ParentClass`.                   |
| `Height`            | `string`                                  | The `height` CSS style of the `div.k-animation-container` element.                                                                                                                          |
| `HideDelay`         | `int`                                     | The milliseconds between the closing animation and the Animation Container removal from the DOM.                                                                                            |
| `Left`              | `string`                                  | The `left` CSS style of the `div.k-animation-container` element.                                                                                                                            |
| `ParentClass`       | `string`                                  | The custom CSS class to be rendered on the `<div class="k-animation-container>` element. This is the outermost component element, which has the position and dimension styles. See `Class`. |
| `ParentInlineStyle` | `string`                                  | The custom inline CSS styles to be rendered on the `div.k-animation-container` element.                                                                                                     |
| `ShowDelay`         | `int`                                     | The time in millisends between the Animation Container rendering and the opening animation.                                                                                                 |
| `Top`               | `string`                                  | The `top` CSS style of the `div.k-animation-container` element.                                                                                                                             |
| `Width`             | `string`                                  | The `width` CSS style of the `div.k-animation-container` element.                                                                                                                           |

## AnimationContainer Reference and Methods

The Animation Container provides methods for programmatic operation. To use them, define a reference to the component instance with the `@ref` attribute. The available methods are:

* `ShowAsync()` - to display the component;
* `HideAsync()` - to hide the component;
* `ToggleAsync()` - if you want to use a single method for both operations.

> tip To show an Animation Container immediately when the page loads, use the `OnAfterRenderAsync` event.

> caption Use AnimationContainer reference and methods

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

## See Also

* [Live Demos: Animation Container](https://demos.telerik.com/blazor-ui/animationcontainer/overview)
* [AnimationContainer API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikanimationcontainer)
* [Hide the AnimationContainer on Outside Click](https://www.telerik.com/blazor-ui/documentation/knowledge-base/animationcontainer-close-on-outside-click)
* [Create Fly-Out Popup with AnimationContainer](https://www.telerik.com/blazor-ui/documentation/knowledge-base/animationcontainer-like-animated-floatingactionbutton)
* [Comparison between All Popup Components](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-popup-component-comparison)
