- Home
- /
- Design
- /
- DMBBootstrapBuilder
- /
- SideBar
Sidebar
A collapsible navigation panel with sections and nested link groups.
SideBarComponent
Instantiate SideBarComponent, call AddSection(title, items) one or more times, then call Render(Html) to output the sidebar HTML.
SideBarComponent
C#
@using DMBBootstrapBuilder
@(new SideBarComponent()
.AddSection("Foundation",
ActionItemFactory.Url("Block", "/Block").SetTitle("Block"),
ActionItemFactory.Url("Row & Col", "/RowAndCol").SetTitle("Row & Col"),
ActionItemFactory.Url("Section", "/Section").SetTitle("Section"),
ActionItemFactory.Url("Card", "/Card").SetTitle("Card"),
ActionItemFactory.Url("Table", "/Table").SetTitle("Table")
)
.AddSection("Layout",
ActionItemFactory.Url("Nav Bar", "/NavBar").SetTitle("Nav Bar"),
ActionItemFactory.Url("Sidebar", "/SideBar").SetTitle("Sidebar"),
ActionItemFactory.Url("Footer Bar", "/FooterBar").SetTitle("Footer Bar")
)
.Render(Html))Multiple Sections
Each AddSection() call creates a labelled group. Pass null as the title for an untitled section.
Multiple sections
C#
@using DMBBootstrapBuilder
@(new SideBarComponent()
.AddSection("Effects",
ActionItemFactory.Url("Image Effects", "/ImageEffect").SetTitle("Image Effects"),
ActionItemFactory.Url("Inner Section", "/InnerSectionEffect").SetTitle("Inner Section"),
ActionItemFactory.Url("Section Effects", "/SectionEffect").SetTitle("Section Effects")
)
.AddSection("Settings",
ActionItemFactory.Url("Theme", "/Theme").SetTitle("Theme"),
ActionItemFactory.Url("RTL", "/RTL").SetTitle("RTL"),
ActionItemFactory.Url("Fluid", "/Fluid").SetTitle("Fluid")
)
.Render(Html))
Session Consent : Consent to use session for this website