Sidebar

Composable app-shell column with header, footer, groups, menus, and a rail toggle. Collapses with a 200ms width transition, falls back to a Sheet on mobile, and persists open state to a cookie via Sidebar.Provider.

Usage

Wrap a page in Sidebar.Provider to get the collapsible app shell. The preview below uses collapsible="none" to keep the demo self-contained.

Workspace
Navigation
v0.1 · Bloom

Dashboard

Content area — replace with your page routes. The real shell uses Sidebar.Inset as the main region.

Anatomy

  • Sidebar.Provider — shell + open state + cookie persistence
  • Sidebar.Root — the sidebar column (variant: sidebar | floating | inset)
  • Sidebar.Header / Content / Footer — vertical slots
  • Sidebar.Group + GroupLabel + GroupContent + GroupAction — section framing
  • Sidebar.Menu + MenuItem + MenuButton + MenuAction + MenuBadge — primary nav items
  • Sidebar.MenuSub + MenuSubItem + MenuSubButton — nested items
  • Sidebar.MenuSkeleton — loading placeholder rows
  • Sidebar.Rail — edge handle that toggles collapsed state
  • Sidebar.Trigger — any-location toggle button
  • Sidebar.Separator — divider between groups
  • Sidebar.Input — search field styled for the rail
  • Sidebar.Inset — the main content region paired with the sidebar

App shell

Full composition: header + two nav groups + separator + user footer + inset main region. This preview uses collapsible="none" so the sidebar stays inside the preview box — the collapsible "icon" / "offcanvas" modes use position: fixed against the viewport and only work at the root of a real app layout, not embedded inside the docs page.

Bloom
Platform
Settings
Dashboard

Inset content area. In a real app this is wrapped with Sidebar.Inset and the shell lives at the route layout root so collapsible="icon" can position the sidebar fixed to the viewport edge.

Nested menu

Sidebar.MenuSub tucks a child list under a top-level item — common pattern for collapsible doc trees or nested settings.

Workspace

Nested items live under Sidebar.MenuSub.

Sidebar.Provider accepts open, defaultOpen, onOpenChange. Every subcomponent forwards HTML attributes unless noted.

PropTypeDescription
'left' | 'right'Which edge the sidebar docks to.
'sidebar' | 'floating' | 'inset'Shell style. Floating detaches the column with a ring + shadow; inset pairs with a rounded inset main region.
'offcanvas' | 'icon' | 'none'How the sidebar collapses. Offcanvas slides the column off-screen; icon shrinks to a narrow rail; none disables collapsing.
stringMerged onto the container via tailwind-merge.
PropTypeDescription
booleanMarks the button as the active route. Applies the active background + foreground.
'default' | 'outline'Visual treatment of the button.
'sm' | 'default' | 'lg'Controls height and padding.
string | SnippetText shown in a Tooltip when the sidebar is collapsed to icon mode.