# Blazor StackLayout Overview

The <a href="https://www.telerik.com/blazor-ui/stacklayout" target="_blank">StackLayout for Blazor</a> is a component that easily aligns multiple elements in a vertical or horizontal order.

## Creating Blazor StackLayout

1. Use the `<TelerikStackLayout>` tag to add the component to your razor page.

2. Inside the `<TelerikStackLayout>` tag, add the desired HTML containers (e.g. `<div>`) or components. Each immediate child element will represent one stack layout item.

3. Set `Width` and `Height`.

4. (optional) Set the `Orientation` parameter to determine the layouts direction.

> caption StackLayout basic configuration.

<demo metaUrl="client/stacklayout/overview/example-2/" height="420"></demo>

## Layout

The layout is the building block of the StackLayout component. Control its appearance via different parameters. [Read more about the Blazor StackLayout layout](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout).

## StackLayout Parameters

The Blazor StackLayout provides various parameters that allow you to configure the component:

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

| Parameter         | Type and Default Value                                                         | Description                                                                                                                                                                                                                                                  |
| ----------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Class`           | `string`                                                                       | The CSS class to be rendered on the main wrapping element of the StackLayout component, which is `<div class="k-stack-layout">`. Use for [styling customizations](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/override-theme-styles). |
| `Height`          | `string`                                                                       | The StackLayout height as a CSS unit. See the [Dimensions](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions) article for more details on what units you can use and how percentage dimensions work.                                |
| `Width`           | `string`                                                                       | The StackLayout width as a CSS unit. See the [Dimensions](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions) article for more details on what units you can use and how percentage dimensions work.                                 |
| `Orientation`     | `StackLayoutOrientation` enum <br/> (`StackLayoutOrientation.Horizontal`)      | Whether the content will be aligned horizontally or vertically. See the [Layout Orientation](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout#orientation) article for more information.                                        |
| `Spacing`         | `string`                                                                       | The space between the elements in the StackLayout. See the [Layout Spacing](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout#spacing) article for more information.                                                             |
| `HorizontalAlign` | `StackLayoutHorizontalAlign` enum <br/> (`StackLayoutHorizontalAlign.Stretch`) | The StackLayout items alignment based on the X axis. See the [Layout HorizontalAlign](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout#horizontalalign) article for more information.                                           |
| `VerticalAlign`   | `StackLayoutVerticalAlign` enum <br/> (`StackLayoutVerticalAlign.Stretch`)     | The StackLayout items alignment based on the Y axis. See the [Layout VerticalAlign](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout#verticalalign) article for more information.                                               |

## Nested StackLayouts

Sometimes you may need to create a more complex layout that includes both horizontal and vertical items. To do that, nest `TelerikStackLayout` components inside one another.

> caption Use nested StackLayout to create a page layout.

<demo metaUrl="client/stacklayout/overview/example-1/" height="320"></demo>

## Next Steps

* [Configure StackLayout orientation, spacing and alignment](https://www.telerik.com/blazor-ui/documentation/components/stacklayout/layout)

## See Also

* [Live StackLayout Demos](https://demos.telerik.com/blazor-ui/stacklayout/overview)
* [StackLayout API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikstacklayout)
