115 Components
Sidebar
NavigationCollapsible kinetic navigation sidebar with spring layout expansion, active selection capsule, popout hover tooltips, and nested sub-items.
NewSpring PhysicsCollapsibleA11y Ready
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 />.
| Prop | Type | Default | Description |
|---|---|---|---|
| sections | SidebarSection[] | DEFAULT_SECTIONS | Array of grouped navigation sections with items, icons, and badges. |
| activeId | string | "dashboard" | Identifier of the currently active navigation item. |
| collapsed | boolean | false | Controlled state determining whether the sidebar is collapsed. |
| collapsible | boolean | true | Whether the toggle button to collapse/expand the sidebar is displayed. |
| user | SidebarUser | — | 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.