ThiloDesign System
DV

Sidebar

shadcn/ui

Full-screen layout primitive. Manages collapse state, keyboard shortcut, and mobile sheet automatically.

@/components/ui/sidebar

Live usage

You are looking at it right now. The left navigation panel on this page is a Sidebar instance. The current implementation lives in src/components/app-shell.tsx.

Press ⌘B to toggle it.

Architecture — how Thilo uses it

1. Wrap app in SidebarProvider

Provides collapse state context to all children. Place in layout.tsx.

2. Render Sidebar inside AppShell

Contains Header + Content (with SidebarGroups) + Footer.

3. Add SidebarTrigger to top bar

Opens/closes the sidebar. ⌘B also works automatically.

4. Use SidebarMenuButton with isActive

Highlights the current route using usePathname() from next/navigation.

Sub-components

ComponentRole
SidebarProviderWraps the entire app layout. Manages open/closed state and keyboard shortcut (⌘B)
SidebarThe panel itself. side: "left" | "right". variant: "sidebar" | "floating" | "inset"
SidebarTriggerToggle button — usually placed in the top bar
SidebarHeaderTop slot — logo, workspace switcher
SidebarContentScrollable middle area — contains SidebarGroups
SidebarFooterBottom slot — user avatar, sign out
SidebarGroupNamed section within the sidebar
SidebarGroupLabelSmall uppercase label above a group of nav items
SidebarGroupContentWrapper for the items inside a group
SidebarMenuVertical list of nav items
SidebarMenuItemSingle row in the nav list
SidebarMenuButtonClickable row — icon + label. isActive highlights the current route
SidebarMenuBadgeRight-aligned badge on a menu item (e.g. unread count)
SidebarMenuSubNested sub-items (collapsible tree)
SidebarMenuSubItemRow inside a sub-menu
SidebarMenuSubButtonClickable row inside a sub-menu
SidebarSeparatorHorizontal divider between groups
SidebarRailThin drag-handle strip on the sidebar edge for resizing

On mobile the sidebar automatically switches to a Sheet (slide-over). No extra code needed — SidebarProvider handles this via a breakpoint hook.

On this page