Layout
TwNavbar
TwNavbar is a responsive Blazor navbar with BrandContent, NavigationContent and ActionsContent slots, data-driven NavigationItems and keyboard support.
Last updated
Data-Driven Links
Pass
NavigationItems instead of hand-written NavigationContent to render links (with optional icons) from a List<NavigationItem>, and mark one active with IsActive. Other slots such as BrandContent and ActionsContent still work alongside it.
Disable Responsive Collapse
Set
DisableResponsiveCollapse to keep the navigation and actions slots always visible with no mobile toggle - useful when a parent layout, such as TwSidebar, already owns a mobile toggle. TwSidebar sets this on its embedded navbar for exactly that reason.
Theme Configuration
Styling is controlled by
TwBlazorTheme.Components (a TwSidebarTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
| Property | Type | Controls |
|---|---|---|
SkipLink |
string | |
MobileOverlay |
string | |
MobileClosed |
string | |
MobileOpen |
string | |
NavigationList |
string | |
NavbarFixedInset |
string | |
NavbarNavigationResponsive |
string | |
NavbarNavigationExpanded |
string | |
Navbar |
string | |
NavbarContent |
string | |
NavbarBrand |
string | |
NavbarNavigation |
string | |
NavbarActions |
string | |
NavbarToggle |
string | |
NavbarToggleIcon |
string | |
NavbarLink |
string | |
NavbarLinkActive |
string | |
NavbarMobileMenu |
string | |
Sidebar |
string | |
MainContent |
string | |
MainContentRoot |
string | |
NavigationItemBase |
string | |
NavigationItemActive |
string | |
NavigationDropdownContainer |
string | |
NavigationItemActiveLevelDeep |
string | |
NavigationDropdownContainerDeep |
string | |
NavigationGroupRailDeep |
string | |
NavigationItemToggleLabel |
string | |
NavigationItemToggleIcon |
string |
Full reference: TwSidebarTheme on the API docs.