Sidebar
v1.0.17Updated 19 Oct 2026Primary vertical navigation panel. Sections with collapsible groups, item badges, active highlight, and collapsed/expanded states. The "MA" workspace badge centers correctly in collapsed icon-only mode.
Preview
Live · 11 stories▸Why this is recommendednavsidebarmenushell+1
The default, out-of-the-box Sidebar.
- ✓Primary nav of every app page
- ✓A left menu users can shrink to an icon rail and expand back
- ✓A Next.js or React Router app whose menu must navigate without reloading the page
- Built-in shrink/expand toggle (`collapsible`) — icon rail and back, no consumer state needed
- Collapsible (icon-only) mode, controlled via `collapsed` or uncontrolled
- Grouped sections with separators
- Item badges (count / dot)
- Active route highlight
- Footer slot for user / workspace
- Client-side routing: `linkComponent` renders every href row with the host link (next/link, React Router Link) instead of a plain anchor
- Tells an ancestor when a row navigated: wrap in `SidebarNavigateBoundary` and a temporary surface (AppShell mobile drawer, a custom drawer) can close itself — fires for href rows only, and not for a modifier or non-primary click
- Link `onClick` receives the click event, so a host can preventDefault and route itself
- ✕In-page tab navigation (use Tabs)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
collapsedCollapsed icon-only rail. Pass to control the state; omit with `collapsible` for built-in toggling
—collapsibleRender the built-in shrink/expand footer control (uncontrolled unless `collapsed` is passed)
—defaultCollapsedInitial state when uncontrolled and `collapsible`
—onCollapsedChangeFired when the built-in control toggles
—sectionsGrouped navigation. Each SidebarSection = { title?: ReactNode, links: SidebarLink[] }; a SidebarLink = { label, href, icon, id?, count?, active?, description?, children?, onClick? } (icon required; nest via children). `onClick` receives the click EVENT, so a host can event.preventDefault() and hand the destination to its router; a row with onClick and no href renders a button. `description` adds a hover/focus tooltip explaining where the link goes — shown in BOTH expanded and collapsed modes, with the label as its heading; omit it for the previous behaviour (no tooltip while expanded). `title` is a ReactNode so a section heading can carry an affordance beside its name. MCP feedback fb_94f476df.
—activeHrefActive link href, matched against SidebarLink.href for the active highlight
—appBrandBrand/workspace block at the top (label + icon/initials)
—pinnedPinned items rendered above sections; pairs with onPin / onUnpin
—recentRecent items rendered at the bottom of the scroll area
—workspaceWorkspace footer (name + storage meter) above the user block
—userFooter user pill; onUserClick opens an account menu
—labelsi18n overrides merged over DEFAULT_SIDEBAR_LABELS
—linkComponentThe host app link component used for EVERY row that has an href — nav links, nested children, pinned items and recent items. Pass next/link or React Router Link so a menu click routes client-side; the default plain anchor reloads the whole document, loses client state, and a click landing before the new page hydrates does nothing. It receives the anchor props the built-in link got (href, className, aria-current, onClick). MCP feedback fb_bf7dc63a.
—