# Blazor TileLayout Overview

The <a href = "https://www.telerik.com/blazor-ui/tilelayout" target="_blank">Blazor TileLayout component</a> is based on the two-dimensional <a href="https://css-tricks.com/snippets/css/complete-guide-grid/" target="_blank">CSS grid</a> and displays its content in tiles. Users can [drag to rearrange](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/reorder) and [drag to resize](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/resize) tiles. The tiles can span across multiple rows and columns. This allows you to build customizable dashboards for your users, save and restore the [layout state](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/state).

## Creating Blazor TileLayout

1. Use the `TelerikTileLayout` tag.
2. Set the desired number of `Columns` for the layout.
3. (optional) Configure the `Width`, `Height`, `ColumnWidth` or `RowHeight` to [define the desired dimensions of the layout](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/layout) and the base size of the individual tiles.
4. (optional) set the [`Resizable`](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/resize) and [`Reorderable`](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/reorder) parameters to `true` to allow the user to alter the layout.
5. Add `<TileLayoutItem>` instances inside a `<TileLayoutItems>` tag. Set the `HeaderText` parameter of each tile, and add a nested `<Content>` tag for the [tile content](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/tile-content).
6. (optional) Set the `RowSpan` and `ColSpan` parameters of the tiles to values larger than `1` to increase their size in the grid.

> caption Basic Tile Layout

<demo metaUrl="client/tilelayout/overview/example-2/" height="720"></demo>

## Layout and Appearance

The TileLayout is based on the *CSS Grid* concept. Basically, [the component layout depends on columns and rows with predefined or automatic dimensions](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/layout). You can set the spacing between rows and columns. Finally, tiles can also span over multiple rows and columns.

## Tile Content

Each tile (`<TileLayoutItem>`) in the TileLayout provides a few configuration options to [control its header and content](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/tile-content).

## Resizing

Users can [resize individual tiles](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/resize) for better user experience and content visibility.

## Reordering

Users can also [rearrange tiles](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/reorder), according to their preferences.

## State

The [Tile Layout allows getting and setting its state](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/state). The TileLayout state contains information about the tiles' order, column span and row span.

## Events

The Tile Layout fires [events when the user resizes or rearranges tiles](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/events). This allows custom logic execution, refreshing of nested components and saving the [TileLayout state](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/state) for later restore.

## TileLayout Parameters

The following table lists the Tile Layout parameters. Also check the [TileLayout API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.teleriktilelayout) for a full list of all properties, 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-tilelayout">` element. Use it to [override theme styles](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/override-theme-styles). |
| `ColumnSpacing` | `string` <br /> (`"16px"`) | The empty space between columns.                                                                                                                                                               |
| `Columns`       | `int`                      | The number of columns in the Tile Layout.                                                                                                                                                      |
| `ColumnWidth`   | `string`                   | The width of one tile. If not set, the tile widths will distribute evenly.                                                                                                                     |
| `Height`        | `string`                   | The Tile Layout height. If not set, the component will expand automatically to fit all rows.                                                                                                   |
| `Navigable`     | `bool`                     | Enables [keyboard navigation](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/accessibility/wai-aria-support#keyboard-navigation).                                       |
| `RowHeight`     | `string`                   | The height of one tile. If not set, the base tile height will be set by the component, based on the highest tile.                                                                              |
| `RowSpacing`    | `string` <br /> (`"16px"`) | The empty space between rows.                                                                                                                                                                  |
| `Reorderable`   | `bool`                     | Enables tile reordering.                                                                                                                                                                       |
| `Resizable`     | `bool`                     | Enables tile resizing. If set, values for both `RowHeight` and `ColumnWidth` must also be provided.                                                                                            |
| `Width`         | `string`                   | The Tile Layout width. If not set, the component will expand horizontally to fill its parent.                                                                                                  |

### TileLayoutItem Parameters

| Parameter    | Type and Default Value | Description                                                                                                                                                                                                  |
| ------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Class`      | `string`               | The custom CSS class of the `<div class="k-tilelayout-item">` element. Use it to [override theme styles](https://www.telerik.com/blazor-ui/documentation/styling-and-themes/override-theme-styles).          |
| `ColSpan`    | `int` <br /> (`1`)     | How many columns a tile will span over.                                                                                                                                                                      |
| `HeaderText` | `string`               | The tile header as plain text. For rich text, use a nested `<HeaderTemplate>` tag.                                                                                                                           |
| `Id`         | `string`               | Tile IDs are not rendered in the HTML markup. The component provides them in the [`OnReorder` and `OnResize` event arguments](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/events). |
| `RowSpan`    | `int` <br /> (`1`)     | How many rows a tile will span over.                                                                                                                                                                         |
| `Visible`    | `bool` <br /> (`true`) | Defines the tile visibility.                                                                                                                                                                                 |

## TileLayout Reference

Use the component reference to execute methods and [get or set the TileLayout state](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/state).

| Method     | Description                                                                                                                                                                  |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GetState` | Returns the current state of the Tile Layout as a [`TileLayoutState` object](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.tilelayoutstate). |
| `SetState` | Applies the provided `TileLayoutState` argument as a new state of the Tile Layout.                                                                                           |

<div class="skip-repl"></div>

<demo metaUrl="client/tilelayout/overview/example-1/" height="720"></demo>

## Next Steps

* [Explore Tile Layout appearance settings](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/layout).
* [Find how to set tile content](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/tile-content).
* Enable tile [resizing](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/resize) and [reordering](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/reorder).
* [Handle Tile Layout events](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/events).
* [Manage the Tile Layout state](https://www.telerik.com/blazor-ui/documentation/components/tilelayout/state).

## See Also

* [Live Demo: TileLayout](https://demos.telerik.com/blazor-ui/tilelayout/overview)
* [TileLayout API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.teleriktilelayout)
