-
Notifications
You must be signed in to change notification settings - Fork 80
Icon articles docs #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
61eb23a
docs(menu): icons article
svdimitr d157be4
chore(menu): updates on icons article
svdimitr c81b5c9
chore(menu): improvements on icons article
svdimitr 7eeb2be
docs(drawer): added icons article
svdimitr 3f75f85
chore(drawer): improvements on icons article
svdimitr a84ca19
chore(drawer): code snippet improvements
svdimitr 75d7953
docs(treeview): added icons article and minor changes to Drawer and M…
svdimitr 399c48d
chore(docs): improvements on icons articles
svdimitr 317592c
chore(drawer): improvements on icons article
svdimitr 89efb39
chore(drawer): updates to Icons articles
svdimitr 086d0f1
chore(drawer): fix icon article
marin-bratanov fb6a044
chore(menu): Improvements on Icons article
svdimitr 56086d1
chore(treeview): improvements on Icons article
svdimitr 366a764
chore(docs): changed icon urls
svdimitr 5032ef9
chore: icon articles fixes - blurry images, typos, image url
marin-bratanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| title: Icons | ||
| page_title: Drawer for Blazor | Icon | ||
| description: Icons and images in the Drawer for Blazor | ||
| slug: drawer-icons | ||
| tags: telerik,blazor,drawer,icon,iconclass,image | ||
| published: True | ||
| position: 22 | ||
| --- | ||
|
|
||
| # Drawer Icons | ||
|
|
||
| You can put an image, an icon class or a font icon for each item in the Drawer to illustrate its purpose for your end users. To apply them, use the following properties: | ||
|
|
||
| * for a [Telerik font icon]({%slug general-information/font-icons%}), point the `IconField` parameter of the component to a `string` field of the model that contains the corresponding icon name. | ||
|
|
||
| * for a raster image, point the `ImageUrlField` parameter of the component to a `string` field of the model that contains the url to the icon (relative or absolute). | ||
|
|
||
| * for a custom font icon class, point the `IconClassField` parameter of the component to a `string` field of the model that contains the desired CSS class list which provides the required rules (like font name and glyph symbol). Make sure to also reference the desired font in your app and to use its own recommendations. | ||
|
|
||
| The `IconClassField` and `ImageUrlField` are rendered, respectively, as `<span class="the custom class" />` and as `<img src="the-image-src" />` | ||
|
|
||
| >caption How to use icons in Telerik Drawer | ||
|
|
||
| ````CSHTML | ||
| @* This example shows how to add icons to the Drawer items *@ | ||
|
|
||
| <TelerikDrawer Data="@Data" | ||
| IconField="@nameof(DrawerItem.TelerikIcon)" | ||
| MiniMode="true" | ||
| @bind-Expanded="@DrawerExpanded" | ||
| Mode="DrawerMode.Push" | ||
| @ref="@DrawerRef" | ||
| @bind-SelectedItem="@SelectedItem"> | ||
| <Content> | ||
| <TelerikButton OnClick="@(() => DrawerRef.ToggleAsync())" Icon="@IconName.Menu">Toggle drawer</TelerikButton> | ||
| <div class="m-5"> | ||
| Selected Item: @SelectedItem?.Text | ||
| </div> | ||
| </Content> | ||
| </TelerikDrawer> | ||
|
|
||
| @code { | ||
| bool DrawerExpanded { get; set; } = true; | ||
| TelerikDrawer<DrawerItem> DrawerRef { get; set; } | ||
| DrawerItem SelectedItem { get; set; } | ||
| IEnumerable<DrawerItem> Data { get; set; } = new List<DrawerItem>() | ||
| { | ||
| new DrawerItem { Text = "Current Location", TelerikIcon = IconName.Pin}, | ||
| new DrawerItem { Text = "Navigation", TelerikIcon = IconName.Globe}, | ||
| new DrawerItem { Text = "Favourite Locations", TelerikIcon = IconName.Star}, | ||
| }; | ||
|
|
||
| public class DrawerItem | ||
| { | ||
| public string Text { get; set; } | ||
| public string TelerikIcon { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
|
|
||
| >caption The result from the code snippet above | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| ## See Also | ||
|
|
||
| * [Drawer Overview]({%slug drawer-overview%}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: Icons | ||
| page_title: Menu for Blazor | Icon | ||
| description: Icons and images in the Menu for Blazor | ||
| slug: menu-icons | ||
| tags: telerik,blazor,menu,icon,iconclass,image | ||
| published: True | ||
| position: 15 | ||
| --- | ||
|
|
||
| # Menu Icons | ||
|
|
||
| You can put an image, icon class or a font icon for each item in the Menu to illustrate its purpose for your end users. To apply them, use the following properties: | ||
|
|
||
| * for a [Telerik font icon]({%slug general-information/font-icons%}), point the `IconField` parameter of the component to a string field of the model that contains the corresponding icon name. | ||
|
|
||
| * for a raster image, point the `ImageUrlField` parameter of the component to a `string` field of the model that contains the url to the icon (relative or absolute). | ||
|
|
||
| * for a custom font icon class, point the `IconClassField` parameter of the component to a `string` field of the model that contains the desired CSS class list which provides the required rules (like font name and glyph symbol). Make sure to also reference the desired font in your app and to use its own recommendations. | ||
|
|
||
| The `IconClassField` and `ImageUrlField` are rendered, respectively, as `<span class="the custom class" />` and as `<img src="the-image-src" />` | ||
|
|
||
| >caption How to use icons in Telerik Menu | ||
|
|
||
| ````CSHTML | ||
| @* This example shows how to add icons or images to menu items | ||
| Make sure that you also refernce the OpenIconic font that comes with the Blazor App template to see the custom font icon *@ | ||
|
|
||
| <TelerikMenu Data="@MenuData" | ||
| IconField="@nameof(MenuModel.TelerikIcon)" | ||
| ImageUrlField="@nameof(MenuModel.MyImage)" | ||
| IconClassField="@nameof(MenuModel.MyIconClass)"> | ||
| </TelerikMenu> | ||
|
|
||
| @code { | ||
| public List<MenuModel> MenuData { get; set; } | ||
|
|
||
| protected override void OnInitialized() | ||
| { | ||
| GenerateMenuData(); | ||
| } | ||
|
|
||
| public void GenerateMenuData() | ||
| { | ||
| MenuData = new List<MenuModel>() | ||
| { | ||
| new MenuModel() | ||
| { | ||
| Text = "IconField", | ||
| TelerikIcon = IconName.Email | ||
| }, | ||
| new MenuModel() | ||
| { | ||
| Text = "IconClassField", | ||
| MyIconClass = "oi oi-wrench", | ||
| }, | ||
| new MenuModel() | ||
| { | ||
| Text = "ImageUrlField", | ||
| MyImage = "https://docs.telerik.com/blazor-ui/images/video.png" | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| public class MenuModel | ||
| { | ||
| public string Text { get; set; } | ||
| public string TelerikIcon { get; set; } | ||
| public string MyImage { get; set; } | ||
| public string MyIconClass { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
|
|
||
| >caption The result from the code snippet above | ||
|
|
||
|  | ||
|
|
||
| ## See Also | ||
|
|
||
| * [Menu Overview]({%slug components/menu/overview%}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| title: Icons | ||
| page_title: TreeView for Blazor | Icon | ||
| description: Icons and images in the TreeView for Blazor | ||
| slug: treeview-icons | ||
| tags: telerik,blazor,treeview,icon,iconclass,image | ||
| published: True | ||
| position: 10 | ||
| --- | ||
|
|
||
| # TreeView Icons | ||
|
|
||
| You can put an image, icon class or a font icon for each item in the TreeView to illustrate its purpose for your end users. To apply them, use the following properties: | ||
|
|
||
| * for a [Telerik font icon]({%slug general-information/font-icons%}), point the `IconField` parameter of the component to a string field of the model that contains the corresponding icon name. | ||
|
|
||
| * for a raster image, point the `ImageUrlField` parameter of the component to a `string` field of the model that contains the url to the icon (relative or absolute). | ||
|
|
||
| * for a custom font icon class, point the `IconClassField` parameter of the component to a `string` field of the model that contains the desired CSS class list which provides the required rules (like font name and glyph symbol). Make sure to also reference the desired font in your app and to use its own recommendations. | ||
|
|
||
| The `IconClassField` and `ImageUrlField` are rendered, respectively, as `<span class="the custom class" />` and as `<img src="the-image-src" />` | ||
|
|
||
| >caption How to use icons in Telerik TreeView | ||
|
|
||
| ````CSHTML | ||
| @* This example shows how to add icons or images to the TreeView items | ||
| Make sure that you also refernce the OpenIconic font that comes with the Blazor App template to see the custom font icon *@ | ||
|
|
||
| <TelerikTreeView Data="@TreeViewData"> | ||
| <TreeViewBindings> | ||
| <TreeViewBinding IconClassField="@nameof(TreeViewModel.MyIconClass)" | ||
| ImageUrlField="@nameof(TreeViewModel.MyImageUrl)" | ||
| IconField="@nameof(TreeViewModel.TelerikIcon)" /> | ||
| </TreeViewBindings> | ||
| </TelerikTreeView> | ||
|
|
||
| @code { | ||
| public List<TreeViewModel> TreeViewData { get; set; } | ||
|
|
||
| protected override void OnInitialized() | ||
| { | ||
| GenerateData(); | ||
| } | ||
|
|
||
| public void GenerateData() | ||
| { | ||
| TreeViewData = new List<TreeViewModel>(); | ||
|
|
||
| TreeViewData.Add(new TreeViewModel() | ||
| { | ||
| Id = 1, | ||
| Text = "Company", | ||
| ParentId = null, | ||
| HasChildren = true, | ||
| TelerikIcon = "home" | ||
| }); | ||
|
|
||
| TreeViewData.Add(new TreeViewModel() | ||
| { | ||
| Id = 2, | ||
| Text = "Contact us", | ||
| ParentId = 1, | ||
| HasChildren = false, | ||
| MyIconClass = "oi oi-envelope-closed" | ||
| }); | ||
|
|
||
| TreeViewData.Add(new TreeViewModel() | ||
| { | ||
| Id = 3, | ||
| Text = "Audio", | ||
| ParentId = null, | ||
| MyImageUrl = "https://docs.telerik.com/blazor-ui/images/speaker.png" | ||
| }); | ||
| } | ||
|
|
||
| public class TreeViewModel | ||
| { | ||
| public int Id { get; set; } | ||
| public string Text { get; set; } | ||
| public bool HasChildren { get; set; } | ||
| public int? ParentId { get; set; } | ||
| public string TelerikIcon { get; set; } | ||
| public string MyIconClass { get; set; } | ||
| public string MyImageUrl { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
|
|
||
| >caption The result from the code snippet above, after expanding the first node | ||
|
|
||
|  | ||
|
|
||
| ## See Also | ||
|
|
||
| * [TreeView Overview]({%slug components/treeview/overview%}) | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the menu article