SidebarPro
App and docs sidebars: a folding rail, a workspace switcher, a mail shell, and a docs tree.
DocsA docs layout with a live filtering nav tree, version switcher, and a gliding on this page outline.
- Product or API documentation with a nav tree and page outline.
- Docs that need a version switcher and a filterable tree.
- Pages where the on this page outline should follow scroll.
- Use tree-view for a plain hierarchy outside a docs layout.
- Use sidebar-rail for app navigation.
- Use command-palette for global search across docs.
Installation
Pro source and install commands unlock with a Pro plan.
Usage
Use this for product or API documentation. Load the tree and pages from your content source, route page changes through your router, and point the version switcher at your versioned builds.
import { DocsSidebar } from "@/registry/blocks/docs-sidebar/docs-sidebar"; export default function DocsPage() { return ( <DocsSidebar defaultCollapsed={false} onCollapsedChange={(collapsed) => localStorage.setItem("docs-rail", String(collapsed))} /> );}DocsSidebar
A docs layout with a filterable nav tree, version switcher, page content with code blocks, and an on this page outline that tracks scroll. The tree, pages, and versions are sample content.
defaultCollapsedbooleanfalseStart with the navigation collapsed to its icon rail.onCollapsedChange(collapsed: boolean) => void–Called when the navigation collapses or expands, from the toggle or the [ shortcut.- [
- Toggles the icon rail when focus is not in a text field, menu, or dialog.
- Arrow UporDown, HomeorEnd
- Move through the nav tree.
- Arrow LeftorRight
- Collapse or expand a nav group.
- Enter
- In the filter field, opens the first matching page.
- Escape
- Clears the filter.
- The rail toggle exposes aria-expanded and aria-keyshortcuts="[".
- Filter results are announced as a count in a polite status region.
- The nav tree supports arrow key movement from the search field into the list.
- The outline indicator glides to the heading in view, and the sidebar folds to a rail on a spring.
- Nav groups expand by height as the filter opens matching branches.
- Reduced motion makes the glide and folds instant.
- At 1000px container width and above the outline gets its own 200px column; below 740px it becomes a collapsible bar above the article.
- Below 620px the rail is dropped and the nav tree folds behind a menu button above the content.
- Scroll spy is batched to one requestAnimationFrame per scroll, and ResizeObservers remeasure on width changes.
- The nav tree is not virtualized; very large trees rely on the filter.
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Use for product or API documentation.
- Load the tree and pages from your content source, route page changes through your router, and point the version switcher at your versioned builds.
- Composes Arc search-field, dropdown-menu, code-block, copy-button, badge, avatar, and button.
The full library index for assistants is at /llms.txt.
