115 Components

Sidebar

Navigation

Collapsible kinetic navigation sidebar with spring layout expansion, active selection capsule, popout hover tooltips, and nested sub-items.

NewSpring PhysicsCollapsibleA11y Ready
/r/sidebar.json

Workspace Overview

Live production metrics

Healthy
Monthly Active
48.2k
Avg Latency
12ms
Toggle the chevron in the sidebar header to test spring collapse (260px ↔ 72px) and popout tooltips.

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:framer-motionlucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/sidebar.json"

Props

TypeScript props supported by <Sidebar />.

7 props
PropTypeDefaultDescription
sectionsSidebarSection[]DEFAULT_SECTIONSArray of grouped navigation sections with items, icons, and badges.
activeIdstring"dashboard"Identifier of the currently active navigation item.
collapsedbooleanfalseControlled state determining whether the sidebar is collapsed.
collapsiblebooleantrueWhether the toggle button to collapse/expand the sidebar is displayed.
userSidebarUser—User details displayed in the bottom footer profile card.
onCollapsedChange(collapsed: boolean) => void—Callback fired when the user toggles the sidebar collapse state.
onItemSelect(item: SidebarItem) => void—Callback fired when a navigation item is clicked.

Key Features

  • Smooth Hooke's Law spring physics powering fluid width collapse (68px to 260px).
  • Shared layoutId active indicator pill tracking selection changes with spring damping.
  • Hover popout tooltips automatically enabled in collapsed icon-rail mode.
  • Accordion-style nested submenus with spring-animated height reveal.
  • Grouped section headings, badge counts, and user profile footer card.
  • Full reduced-motion compatibility with instant layout snapping.

Keyboard & Accessibility

  • Semantic <aside aria-label='Application Sidebar'> markup.
  • Supports keyboard focus navigation with clear 2px focus-visible outlines.
  • Exposes aria-current='page' on active selection.
  • Accessible collapse toggle button with screen-reader friendly aria-label and state description.