Skip to content

Commit abc666d

Browse files
docs(stacklayout): Revamp Overview article (#1069)
* docs(stacklayout): Revamp Overview article * docs(stacklayout): fixes as per comments
1 parent da56166 commit abc666d

File tree

1 file changed

+31
-60
lines changed

1 file changed

+31
-60
lines changed

components/stacklayout/overview.md

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,19 @@ position: 0
1010

1111
# Blazor StackLayout Overview
1212

13-
The <a href="https://www.telerik.com/blazor-ui/stacklayout" target="_blank">Blazor StackLayout component</a> allows you to easily align multiple elements in a vertical or horizontal order.
13+
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.
1414

15-
#### In This Article:
15+
## Creating Blazor StackLayout
1616

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

18-
* [Basics](#basics)
19-
* [Features](#features)
20-
* [Nested StackLayouts](#nested-stacklayouts)
19+
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.
2120

22-
## Basics
21+
3. Set `Width` and `Height`.
2322

24-
#### To use a Telerik StackLayout for Blazor
23+
4. (optional) Set the `Orientation` parameter to determine the layouts direction.
2524

26-
1. Declare the `<TelerikStackLayout>` tag
27-
28-
1. Inside the `<TelerikStackLayout>` tag, add the desired elements.
29-
30-
>caption StackLayout with its most common features
25+
>caption StackLayout basic configuration.
3126
3227
````CSHTML
3328
@* This example showcases how the StackLayout fills the entire parent container and some of its core features. *@
@@ -57,58 +52,35 @@ The <a href="https://www.telerik.com/blazor-ui/stacklayout" target="_blank">Blaz
5752
</div>
5853
````
5954

60-
>caption The result from the code snippet above
61-
62-
![overview of the StackLayout functionality](images/stacklayout-overview-basic-example.png)
63-
64-
65-
>caption Component namespace and reference
66-
67-
````CSHTML
68-
<TelerikStackLayout Orientation="@StackLayoutOrientation.Horizontal"
69-
Width="100%"
70-
Height="100%"
71-
@ref="StackLayoutRef">
72-
<div style="background-color: aqua;">
73-
Aqua colored stack item
74-
</div>
75-
<div style="background-color: cornflowerblue;">
76-
Cornflowerblue colored stack item
77-
</div>
78-
<div style="background-color: blue;">
79-
Blue colored stack item
80-
</div>
81-
</TelerikStackLayout>
82-
83-
@code {
84-
Telerik.Blazor.Components.TelerikStackLayout StackLayoutRef { get; set; }
85-
}
86-
````
87-
88-
89-
## Features
90-
91-
The StackLayout offers the following features:
92-
93-
* `Class` - the CSS class that renders on the main wrapping element of the component.
55+
## Layout
9456

95-
* `Height` - takes a CSS unit that determines how tall the StackLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
57+
The layout is the building block of the StackLayout component. Control its appearance via different parameters. [Read more about the Blazor StackLayout layout]({%slug stacklayout-layout%}).
9658

97-
* `Width`- takes a CSS unit that determines how wide the StackLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
59+
## StackLayout Parameters
9860

99-
* `Orientation` - whether the content will be aligned horizontally or vertically. Takes a member of the `StackLayoutOrientation` enum and defaults to `Horizontal`. See the [Layout]({%slug stacklayout-layout%}) article for more information.
61+
The Blazor StackLayout provides various parameters that allow you to configure the component:
10062

101-
* `Spacing` - the space between the elements in the StackLayout. See the [Layout]({%slug stacklayout-layout%}) article for more information.
102-
103-
* `HorizontalAlign` - controls the alignment of the items in the StackLayout based on the X axis. Takes a member of the `StackLayoutHorizontalAlign` enum. See the [Layout]({%slug stacklayout-layout%}) article for more information.
104-
105-
* `VerticalAlign` - controls the alignment of the items in the StackLayout based on the Y axis. Takes a member of the `StackLayoutVerticalAlign` enum. See the [Layout]({%slug stacklayout-layout%}) article for more information.
63+
<style>
64+
article style + table {
65+
table-layout: auto;
66+
word-break: normal;
67+
}
68+
</style>
69+
| Parameter | Type and Default Value | Description |
70+
| ----------- | ----------- | ----------- |
71+
| `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]({%slug themes-override%}). |
72+
| `Height` | `string` | The StackLayout height as a CSS unit. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how percentage dimensions work. |
73+
| `Width` | `string` | The StackLayout width as a CSS unit. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how percentage dimensions work. |
74+
| `Orientation` | `StackLayoutOrientation` enum <br/> (`StackLayoutOrientation.Horizontal`) | Whether the content will be aligned horizontally or vertically. See the [Layout Orientation]({%slug stacklayout-layout%}#orientation) article for more information. |
75+
| `Spacing` | `string` | The space between the elements in the StackLayout. See the [Layout Spacing]({%slug stacklayout-layout%}#spacing) article for more information. |
76+
| `HorizontalAlign` | `StackLayoutHorizontalAlign` enum <br/> (`StackLayoutHorizontalAlign.Stretch`) | The StackLayout items alignment based on the X axis. See the [Layout HorizontalAlign]({%slug stacklayout-layout%}#horizontalalign) article for more information. |
77+
| `VerticalAlign` | `StackLayoutVerticalAlign` enum <br/> (`StackLayoutVerticalAlign.Stretch`) | The StackLayout items alignment based on the Y axis. See the [Layout VerticalAlign]({%slug stacklayout-layout%}#verticalalign) article for more information. |
10678

10779
## Nested StackLayouts
10880

109-
Sometimes you need to create a more complex layout that includes both horizontal and vertical items. To do that, you can nest TelerikStackLayout components inside one another.
81+
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.
11082

111-
>caption Use nested StackLayout to create a page layout
83+
>caption Use nested StackLayout to create a page layout.
11284
11385
````CSHTML
11486
<TelerikStackLayout Orientation="StackLayoutOrientation.Vertical" Height="100%">
@@ -162,12 +134,11 @@ Sometimes you need to create a more complex layout that includes both horizontal
162134
</style>
163135
````
164136

165-
>caption The result from the code snippet above
137+
## Next Steps
166138

167-
![Nested StackLayouts can create complex layout](images/stacklayout-overview-nested-stacklayouts-example.png)
139+
* [Configure StackLayout orientation, spacing and alignment]({%slug stacklayout-layout%})
168140

169141
## See Also
170142

171-
* [Live Demo: StackLayout](https://demos.telerik.com/blazor-ui/stacklayout/overview)
172-
* [Layout]({%slug stacklayout-layout%})
143+
* [Live StackLayout Demos](https://demos.telerik.com/blazor-ui/stacklayout/overview)
173144
* [StackLayout API Reference](https://docs.telerik.com/blazor-ui/api/Telerik.Blazor.Components.TelerikStackLayout)

0 commit comments

Comments
 (0)