-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to specify class on NavItems (#381)
* Allow to specify class on NavItems * Sidebar: Add option to space items #276 - demos update --------- Co-authored-by: Vikram Reddy <[email protected]>
- Loading branch information
1 parent
8f31429
commit 8e2668e
Showing
6 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
41 changes: 41 additions & 0 deletions
41
...rBootstrap.Demo.RCL/Pages/Sidebar/Sidebar_Demo_10_Apply_Custom_CSS_Class_to_NavItem.razor
This file contains 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,41 @@ | ||
<Sidebar @ref="sidebar" | ||
IconName="IconName.BootstrapFill" | ||
Title="Blazor Bootstrap" | ||
DataProvider="SidebarDataProvider" /> | ||
|
||
@code { | ||
Sidebar sidebar; | ||
IEnumerable<NavItem> navItems; | ||
|
||
private async Task<SidebarDataProviderResult> SidebarDataProvider(SidebarDataProviderRequest request) | ||
{ | ||
if (navItems is null) | ||
navItems = GetNavItems(); | ||
|
||
return await Task.FromResult(request.ApplyTo(navItems)); | ||
} | ||
|
||
private IEnumerable<NavItem> GetNavItems() | ||
{ | ||
navItems = new List<NavItem> | ||
{ | ||
new NavItem { Id = "1", Href = "/getting-started", IconName = IconName.HouseDoorFill, Text = "Getting Started"}, | ||
|
||
new NavItem { Id = "2", IconName = IconName.LayoutSidebarInset, Text = "Content" }, | ||
new NavItem { Id = "3", Href = "/icons", IconName = IconName.PersonSquare, Text = "Icons", ParentId="2"}, | ||
|
||
new NavItem { Id = "4", IconName = IconName.ExclamationTriangleFill, Text = "Components" }, | ||
new NavItem { Id = "5", Href = "/alerts", IconName = IconName.CheckCircleFill, Text = "Alerts", ParentId="4", Class="px-3"}, | ||
new NavItem { Id = "6", Href = "/breadcrumb", IconName = IconName.SegmentedNav, Text = "Breadcrumb", ParentId="4", Class="px-3"}, | ||
new NavItem { Id = "7", Href = "/sidebar", IconName = IconName.LayoutSidebarInset, Text = "Sidebar", ParentId="4", Class="px-3"}, | ||
|
||
new NavItem { Id = "8", IconName = IconName.WindowPlus, Text = "Forms" }, | ||
new NavItem { Id = "9", Href = "/autocomplete", IconName = IconName.InputCursorText, Text = "Auto Complete", ParentId="8"}, | ||
new NavItem { Id = "10", Href = "/currency-input", IconName = IconName.CurrencyDollar, Text = "Currency Input", ParentId="8"}, | ||
new NavItem { Id = "11", Href = "/number-input", IconName = IconName.InputCursor, Text = "Number Input", ParentId="8"}, | ||
new NavItem { Id = "12", Href = "/switch", IconName = IconName.ToggleOn, Text = "Switch", ParentId="8"}, | ||
}; | ||
|
||
return navItems; | ||
} | ||
} |
This file contains 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 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 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 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