Skip to content

Commit da56166

Browse files
dimodintacheva
andauthored
docs(tilelayout): Revamp Overview and polish the other pages (#1051)
* docs(tilelayout): Revamp Overview * docs(tilelayout): Revamp Overview 2 * Update components/tilelayout/overview.md Co-authored-by: Nadezhda Tacheva <[email protected]> * docs(tilelayout): Address PR feedback Co-authored-by: Nadezhda Tacheva <[email protected]>
1 parent 8c7cf98 commit da56166

File tree

10 files changed

+266
-176
lines changed

10 files changed

+266
-176
lines changed

components/tilelayout/events.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Events of the TileLayout for Blazor.
55
slug: tilelayout-events
66
tags: telerik,blazor,tile,layout,dashboard,events
77
published: True
8-
position: 20
8+
position: 30
99
---
1010

1111
# TileLayout Events
@@ -126,8 +126,11 @@ The `OnReorder` event provides an argument of type `TileLayoutReorderEventArgs`.
126126
}
127127
````
128128

129+
## Next Steps
130+
131+
* [Manage the Tile Layout state]({%slug tilelayout-state%}).
132+
129133

130134
## See Also
131135

132-
* [TileLayout Overview]({%slug tilelayout-overview%})
133-
* [State]({%slug tilelayout-state%})
136+
* [TileLayout Overview]({%slug tilelayout-overview%})
Binary file not shown.
Binary file not shown.
Binary file not shown.

components/tilelayout/layout.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Layout
3+
page_title: TileLayout - Layout and Appearance Setings
4+
description: Layout and apperance settings of the TileLayout for Blazor.
5+
slug: tilelayout-layout
6+
tags: telerik,blazor,tile,layout
7+
published: True
8+
position: 5
9+
---
10+
11+
# TileLayout Appearance
12+
13+
This article describes how the TileLayout constructs its layout, and what are the parameters that affect its appearance. To understand the component behavior in more depth, get familiar with the concept of [CSS Grid Layout](https://css-tricks.com/snippets/css/complete-guide-grid/) first. The TileLayout component is based on it as underlying implementation and core properties.
14+
15+
The TileLayout component exposes parameters that control its layout at two levels:
16+
17+
* [Main Element](#main-element)
18+
* [Individual Tiles](#individual-tiles)
19+
20+
21+
## Main Element
22+
23+
The main element defines the number of `Columns`, the `Width` and `Height` of the layout, as well as the `ColumnWidth` and `RowHeight`.
24+
25+
The `ColumnWidth` and `RowHeight` define the maximum dimensions for each column and row of the main layout. As the overall component dimensions change (e.g., because of different viewports), the column and row heights might decrease to provide even distribution. A single tile can span more than one column or row.
26+
27+
Generally, you should use settings that allow the desired number of columns and rows (depending on their width and height) to fit in the set width and height of the entire component.
28+
29+
You do not, however, have to set `Width` and `Height` - the main measure is the `Columns` and it will suffice to create a layout.
30+
31+
Since the Tile Layout is a block element, its width defaults to `auto` in the browser, and the actual width is distributed evenly between the number of `Columns`. Setting `Height="100%"` can let the component take up its parent dimensions in terms of height as well.
32+
33+
If the width and height dimensions are insufficient to accommodate the defined row height and column width that the current tiles create, the actual row height and/or column width will decrease so that the appointed number of columns fit in the available width and the existing number of rows fit in the available height.
34+
35+
`Columns`, `Width` and `Height` have no default values.
36+
37+
`ColumnWidth` and `RowHeight` default to `1fr`. Thus, you may want to omit setting a `ColumnWidth` in order to get a more responsive (fluid) layout - all columns will then have the same width - a fraction of the total width.
38+
39+
There are two other settings you should take into account if you set explicit dimensions to the main element - the `ColumnSpacing` and `RowSpacing` - they are CSS units that define the gaps between the individual columns and rows and count towards the total dimensions of the component. They default to `16px`.
40+
41+
Lastly, you can also set the `Class` parameter that renders at the main wrapping element of the tile layout so you can cascade custom CSS rules through it.
42+
43+
44+
## Individual Tiles
45+
46+
Each tile provides settings that define how many columns and rows its takes up - the `ColSpan` and `RowSpan` parameters. It also provides a `Class` parameter so you can cascade CSS rules through it.
47+
48+
`ColSpan` can affect the actual number of `Columns` of the entire layout. For example, if you have a tile with `ColSpan="2"` and `Columns="1"`, the TileLayout will still have two columns.
49+
50+
@[template](/_contentTemplates/tilelayout/basics.md#resizing-reordering-logic)
51+
52+
53+
## Next Steps
54+
55+
* [Find how to set tile content]({%slug tilelayout-tile-content%}).
56+
* Enable tile [resizing]({%slug tilelayout-resize%}) and [reordering]({%slug tilelayout-reorder%}).
57+
* [Handle Tile Layout events]({%slug tilelayout-events%}).
58+
* [Manage the Tile Layout state]({%slug tilelayout-state%}).
59+
60+
61+
## See Also
62+
63+
* [TileLayout Overview]({%slug tilelayout-overview%})

components/tilelayout/overview.md

Lines changed: 75 additions & 156 deletions
Large diffs are not rendered by default.

components/tilelayout/reorder.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Reorder tiles in the TileLayout for Blazor.
55
slug: tilelayout-reorder
66
tags: telerik,blazor,tile,layout,dashboard,reorder
77
published: True
8-
position: 10
8+
position: 20
99
---
1010

1111
# TileLayout Reorder
@@ -20,9 +20,9 @@ To be able to drag and reorder a tile, it must have some [content]({%slug tilela
2020

2121
Reordering a tile fires the [OnReorder event]({%slug tilelayout-events%}#onreorder).
2222

23-
>caption Reordering tiles in the TileLayout
23+
> When the tile layout allows reordering, it captures mouse events in the tile headers. Thus, if you put components in the `HeaderTemplate` of the tiles, they may not function as expected. For example, you may not be able to focus inputs with the mouse. The header is designed for presentation purposes and to allow dragging. We recommend putting editors or complex content in the `Content` of the tiles.
2424
25-
![reorder tiles](images/tilelayout-reordering-overview.gif)
25+
>caption Reordering tiles in the TileLayout
2626
2727
````CSHTML
2828
<TelerikTileLayout ColumnWidth="200px"
@@ -47,11 +47,16 @@ Reordering a tile fires the [OnReorder event]({%slug tilelayout-events%}#onreord
4747
</TelerikTileLayout>
4848
````
4949

50-
>note When the tile layout has reordering enabled, it captures mouse events in its header. Thus, if you put components in the `HeaderTemplate` of `TileLayoutItem` instances, they may not function as expected. For example, you may not be able to focus inputs with the mouse. The header is designed for presentation purposes and to allow dragging, and we recommend you consider putting editors or complex content in the `Content` of the tiles.
50+
![reorder tiles](images/tilelayout-reordering-overview.gif)
51+
52+
53+
## Next Steps
54+
55+
* [Handle Tile Layout events]({%slug tilelayout-events%}).
56+
* [Manage the Tile Layout state]({%slug tilelayout-state%}).
57+
5158

5259
## See Also
5360

54-
* [Overview]({%slug tilelayout-overview%})
55-
* [State]({%slug tilelayout-state%})
56-
* [Events]({%slug tilelayout-events%})
57-
* [Live Demo: TileLayout Reordering](https://demos.telerik.com/blazor-ui/tilelayout/reordering)
61+
* [Overview]({%slug tilelayout-overview%})
62+
* [Live Demo: TileLayout Reordering](https://demos.telerik.com/blazor-ui/tilelayout/reordering)

components/tilelayout/resize.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ description: Resize items in the TileLayout for Blazor.
55
slug: tilelayout-resize
66
tags: telerik,blazor,tile,layout,dashboard,resize
77
published: True
8-
position: 5
8+
position: 15
99
---
1010

1111
# TileLayout Resize
1212

13-
You can resize the tiles by dragging their bottom and right-hand side borders to change the dashboard to your liking.
13+
Resize tiles by dragging their bottom and right borders to change the dashboard to your liking.
1414

1515
To enable resizing, set the `Resizable` parameter of the main `TelerikTileLayout` tag to `true`.
1616

@@ -20,8 +20,6 @@ Resizing a tile fires the [OnResize event]({%slug tilelayout-events%}#onresize).
2020

2121
>caption Resizing tiles in the TileLayout
2222
23-
![resize tiles](images/tilelayout-resizing-overview.gif)
24-
2523
````CSHTML
2624
<TelerikTileLayout ColumnWidth="200px"
2725
RowHeight="150px"
@@ -45,10 +43,17 @@ Resizing a tile fires the [OnResize event]({%slug tilelayout-events%}#onresize).
4543
</TelerikTileLayout>
4644
````
4745

46+
![resize tiles](images/tilelayout-resizing-overview.gif)
47+
48+
49+
## Next Steps
50+
51+
* Enable [tile reordering]({%slug tilelayout-reorder%}).
52+
* [Handle Tile Layout events]({%slug tilelayout-events%}).
53+
* [Manage the Tile Layout state]({%slug tilelayout-state%}).
54+
4855

4956
## See Also
5057

51-
* [Overview]({%slug tilelayout-overview%})
52-
* [State]({%slug tilelayout-state%})
53-
* [Events]({%slug tilelayout-events%})
54-
* [Live Demo: TileLayout Resizing](https://demos.telerik.com/blazor-ui/tilelayout/resizing)
58+
* [Overview]({%slug tilelayout-overview%})
59+
* [Live Demo: TileLayout Resizing](https://demos.telerik.com/blazor-ui/tilelayout/resizing)

components/tilelayout/state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Control, save and load the state of the TileLayout for Blazor.
55
slug: tilelayout-state
66
tags: telerik,blazor,tile,layout,dashboard,state
77
published: True
8-
position: 15
8+
position: 25
99
---
1010

1111
# TileLayout State

components/tilelayout/tile-content.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Tile Content
3+
page_title: TileLayout - Tile Content
4+
description: How to set tile content when using the TileLayout for Blazor.
5+
slug: tilelayout-tile-content
6+
tags: telerik,blazor,tile,layout
7+
published: True
8+
position: 10
9+
---
10+
11+
# Tile Layout Content
12+
13+
This article describes how to set the content of each TileLayout tile.
14+
15+
## Header and Content
16+
17+
To set the tile contents, you have the following options:
18+
19+
* The `HeaderText` is a parameter on the individual tile that renders a simple string in its header portion.
20+
21+
* The `HeaderTemplate` tag lets you define custom content, including components, in the header portion of the tile.
22+
23+
* The `Content` is a `RenderFragment` where you put the content of the tiles - it can range from simple text, to complex components.
24+
25+
>caption Set header and content of tiles
26+
27+
````CSHTML
28+
<TelerikTileLayout ColumnWidth="200px"
29+
RowHeight="150px"
30+
Width="700px"
31+
Columns="3"
32+
Resizable="true"
33+
Reorderable="true">
34+
<TileLayoutItems>
35+
<TileLayoutItem HeaderText="Simple Header Text, no content">
36+
</TileLayoutItem>
37+
<TileLayoutItem HeaderText="Simple Header Text, some content" ColSpan="2">
38+
<Content>You can put components in the tiles too.</Content>
39+
</TileLayoutItem>
40+
<TileLayoutItem ColSpan="2">
41+
<HeaderTemplate>
42+
<strong>Bold</strong> header from a template
43+
</HeaderTemplate>
44+
<Content><p>As with other render fragments, you can put <strong>any</strong> content here</p></Content>
45+
</TileLayoutItem>
46+
</TileLayoutItems>
47+
</TelerikTileLayout>
48+
````
49+
50+
51+
## Content Scrollbars
52+
53+
The Tile Layout component targets modern web development and thus - responsive dimensions for the content. Therefore, we expect that most content will have `width: 100%; height: 100%;` so that it can stretch according to the size of the tile that the end user chooses.
54+
55+
If you want to change that (for example, because you have certain content that requires dimensions set in `px`), you can use the `Class` of the individual tile and choose the required setting for the `overflow` CSS rule of the `div.k-tilelayout-item-body` element in that particular tile.
56+
57+
>caption Content scrollbars and overflow behavior in the Tile Layout
58+
59+
````CSHTML
60+
<TelerikTileLayout ColumnWidth="300px"
61+
RowHeight="150px"
62+
Columns="3"
63+
Resizable="true"
64+
Reorderable="true">
65+
<TileLayoutItems>
66+
<TileLayoutItem HeaderText="Responsive Content">
67+
<Content>
68+
<div style="width: 100%; height: 100%; background: lime;">My size fits</div>
69+
</Content>
70+
</TileLayoutItem>
71+
<TileLayoutItem HeaderText="Static Content">
72+
<Content>
73+
<div style="width: 600px; height: 300px; background: yellow;">I will be cut off by default. I will be cut off by default. I will be cut off by default.</div>
74+
</Content>
75+
</TileLayoutItem>
76+
<TileLayoutItem HeaderText="Custom Scrollbars" Class="tile-with-overflow">
77+
<Content>
78+
<div style="width: 600px; height: 300px; background: cyan;">I produce scrollbars</div>
79+
</Content>
80+
</TileLayoutItem>
81+
</TileLayoutItems>
82+
</TelerikTileLayout>
83+
84+
<style>
85+
.tile-with-overflow .k-tilelayout-item-body {
86+
overflow: auto;
87+
}
88+
</style>
89+
````
90+
91+
## Next Steps
92+
93+
* Enable tile [resizing]({%slug tilelayout-resize%}) and [reordering]({%slug tilelayout-reorder%}).
94+
* [Handle Tile Layout events]({%slug tilelayout-events%}).
95+
* [Manage the Tile Layout state]({%slug tilelayout-state%}).

0 commit comments

Comments
 (0)