Skip to content

Commit 385aff7

Browse files
docs(menu): orientation
1 parent 6ebdd14 commit 385aff7

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
94.9 KB
Loading

components/menu/orientation.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Orientation
3+
page_title: Menu for Blazor | Orienatation
4+
description: Orientation on the Menu for Blazor
5+
slug: components/menu/orientation
6+
tags: telerik,blazor,menu,events
7+
published: true
8+
position: 10
9+
---
10+
11+
# Orientation
12+
13+
You can control the orientation of the Menu for Blazor so that it orders its items horizontally or vertically.
14+
15+
>caption Changing the orientation of a menu
16+
17+
![](images/menu-change-orientation.gif)
18+
19+
>caption Set orientation
20+
21+
````CSHTML
22+
@using Telerik.Blazor.Components.Menu
23+
24+
<TelerikMenu Data="@MenuItems" OnSelect="@OnSelect">
25+
</TelerikMenu>
26+
27+
Last item selected: @SelectedItem?.Text
28+
29+
@code {
30+
public List<MenuItem> MenuItems { get; set; }
31+
32+
public class MenuItem
33+
{
34+
public string Text { get; set; }
35+
public string Icon { get; set; }
36+
public List<MenuItem> Items { get; set; }
37+
}
38+
39+
protected override void OnInitialized()
40+
{
41+
MenuItems = new List<MenuItem>()
42+
{
43+
new MenuItem()
44+
{
45+
Text = "Share",
46+
Icon = "k-i-share",
47+
Items = new List<MenuItem>()
48+
{
49+
new MenuItem()
50+
{
51+
Text = "FaceBook",
52+
Icon = "k-i-facebook"
53+
},
54+
new MenuItem()
55+
{
56+
Text = "LinkedIn",
57+
Icon = "k-i-linkedin"
58+
},
59+
new MenuItem()
60+
{
61+
Text = "Twitter",
62+
Icon = "k-i-twitter"
63+
},
64+
}
65+
},
66+
new MenuItem()
67+
{
68+
Text = "Map Location",
69+
Icon = "k-i-marker-pin"
70+
}
71+
};
72+
73+
base.OnInitialized();
74+
}
75+
}
76+
````
77+
78+
79+
## See Also
80+
81+
* [Menu Overview]({%slug components/menu/overview%})
82+
* [Live Demo: Orientation](https://demos.telerik.com/blazor-ui/menu/orientation)

0 commit comments

Comments
 (0)