Browse components

SidebarNavigation

Sidebar navigation for app shells, with clear active states and optional search. Use it to give users steady orientation.

organisms 4 variants
Variants / states: expandedcollapsedsearchMode: inputsearchMode: button

Live example

Default usage you can copy and adapt.

Default

Expanded sidebar with a current page highlight and a simple search flow.

Search trigger + panel

Use button-trigger search when results need more space than an inline input.

Collapsed rail

Icon-only rail. Labels move into tooltips and item badges become a dot, so a notification count is not lost on collapse.

Props

The props you are most likely to need, with types and defaults.

Props / API
NameTypeRequiredDefaultDescription
mode'expanded' | 'collapsed'NoexpandedSidebar display mode
layout'rail' | 'card'NorailRail attaches to the viewport edge; card is a rounded floating panel on a soft surface
itemsSidebarNavigationItem[]No[]Primary and secondary sidebar items; optional section groups primary rows under headings
currentPathstringNo—Active route path used for selected styling
activePrimaryHrefstringNo—Parent nav href to highlight when currentPath is a deeper leaf
ariaLabelstringNoSidebar navigationAccessible name for the nav landmark
classstringNo—Extra classes, merged last so they win
classNamestringNo—Deprecated alias for class
logoSrcstringNo—Optional logo image URL
logoAltstringNo—Accessible label for the logo image
brandNamestringNo—Optional product name beside the logo
showProfilebooleanNotrueRender the account row in the footer
profileNamestringNoZabiAccount display name
profileEmailstringNohello@zabi.devAccount secondary line
profileInitialsstringNoZAAvatar initials fallback
showSearchbooleanNotrueRender the search affordance
searchMode'input' | 'button'NoinputInline input, or a button that opens your own panel
searchPlaceholderstringNoSearch...Placeholder, and the button label in trigger mode
searchValuestringNo—Bindable search term; filters items in input mode
searchTriggerIconComponentNoCommandTrigger icon in button mode or when collapsed
searchTriggerVariantButtonVariantNooutlineButton variant for the search trigger
searchTriggerSizeSizeVariantNosmButton size for the search trigger
showLogoutbooleanNotrueRender the logout row
logoutLabelstringNoLogoutLogout row label
showThemeTogglebooleanNotrueRender the light/dark toggle
lightModeLabelstringNoLight modeTheme toggle label
isLightModebooleanNofalseBindable theme toggle state
emptyStateTitlestringNoCreate your first navigation itemHeading when there are no items
emptyStateDescriptionstringNoAdd your first sidebar item so users can start navigating your product.Body copy when there are no items
emptyStateActionLabelstringNoAdd navigation itemCall to action when there are no items
onNavigate(item, event) => voidNo—Fires on item click; call preventDefault for client routing
onSearchClick() => voidNo—Fires when the search trigger is pressed (button mode)
onLogout() => voidNo—Fires when logout is pressed
onThemeToggle(next: boolean) => voidNo—Fires with the next light-mode value
onEmptyStateAction() => voidNo—Fires when the empty-state action is pressed
onProfileClick(event?) => voidNo—Fires when the account row is pressed
profilePanelOpenbooleanNofalseWhether your account panel is open (drives aria-expanded)
profilePanelControlsIdstringNo—Id of your account panel, for aria-controls
profilePanelSnippetNo—Snippet rendered as the account panel