Wrap the tree in SidebarProvider. Use SidebarInset for the main content region—required when variant="inset". On viewports below the desktop breakpoint, Sidebar renders as a sheet dialog; keep the layout inside ThemeProvider so the portal container resolves. Composition and behavior follow the shadcn/ui Sidebar pattern.
Default off-canvas sidebar with nested Collapsible sections, truncated labels, and a trigger in the inset header. Use variant="sidebar" (recommended). floating and inset exist for shadcn parity but are not recommended for product layouts.
Set collapsible="icon" so the desktop sidebar collapses to icons. Tooltips on SidebarMenuButton appear in icon mode; place SidebarTrigger placement="footer" in SidebarFooter to toggle open state (as in the top preview). Ctrl+B / Cmd+B also toggles the sidebar.
Pin navigation from a left Drawer (overlay; main content stays full width) into a docked Sidebar + SidebarInset layout (sidebar reserves width and shifts content). Place a pin control in the drawer header to dock; use PinOff in SidebarHeader to return to the drawer.
The tables below mirror the shadcn/ui Sidebar API and the @by/experience-system implementation in packages/experience-system/src/components/Sidebar. Design-system extensions (RTL defaults, token styling, truncated-label tooltips) are called out inline.
Button that toggles the sidebar. Extends Button props (variant, size, className, …).
Prop
Type
Default
placement
"header" | "footer"
"footer"
(Button props)
Button props
variant="ghost", size="md", icon
placement: Footer (default) toggles ColumnShow / ColumnHide with RTL mirroring. Header uses LayoutSidebar on desktop and Menu on mobile; header icons are not mirrored in RTL. Stacks above SidebarRail (z-30 vs rail z-20) so the end-aligned footer trigger stays visible and clickable.
tooltip: Shows in collapsed icon mode; when expanded, wraps a trailing <span> label with overflow tooltip (SidebarTruncatedLabel) unless labelOverflow="wrap".
Submenu link or button. Default element is <a> for leaf navigation (asChild + router link is preferred). When isFolder is set, renders <button type="button"> for collapsible section triggers (use with CollapsibleTrigger asChild).
Utility span that shows a tooltip when label text overflows. Used internally by menu buttons when tooltip is set.
Prop
Type
Default
labelOverflow
"truncate" | "wrap"
"truncate"
side
"top" | "right" | "bottom" | "left"
Reading-direction side
(span props)
span HTML attributes
—
labelOverflow: truncate (default) ellipsizes overflowing text and shows a tooltip on hover. wrap breaks long labels across multiple lines with no overflow tooltip.
Use landmark and navigation semantics in the page shell (nav, aria-current on active routes via isActive styling). SidebarTrigger and SidebarRail expose Toggle Sidebar labels. On mobile, the sidebar sheet uses Radix Dialog focus management (Dialog accessibility).
Toggles the sidebar (desktop open/collapse or mobile sheet).
Space / Enter
Activates the focused menu button, link, or SidebarTrigger.
Esc
Closes the mobile sheet when open.
For collapsible sections inside the sidebar, see Collapsible keyboard interactions on CollapsibleTrigger. Nested branch rows must keep SidebarMenuSubItem (<li>) children inside SidebarMenuSub (<ul>). Folder sub-rows with isFolder render as <button> so aria-expanded from CollapsibleTrigger is valid.
Source in the repo: packages/experience-system/src/components/Sidebar/Sidebar.tsx. Agent-oriented contracts: packages/experience-system/src/components/Sidebar/Sidebar.instructions.md.