Sidebar
A full-height navigation panel: fixed hero header, internally scrolling nav (with nested children), and a fixed user footer/menu. @startingPoint section="Layout" subtitle="Full-height sidebar — hero, scrolling nav & user menu" viewport="300x720"
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A full-height navigation panel: fixed hero header, internally scrolling nav (with nested children), and a fixed user footer/menu.
Accessibility
Landmark structure (header/nav/footer) with skip-to-content support. Collapsible navigation keeps an accessible name when collapsed.
Install and import
npx shadcn@latest add @prism/sidebar
import { Sidebar } from '@/components/prism/Sidebar';
In a no-build prototype, read it from the bundle instead: const { Sidebar } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
side | "left" | "right" | — | Which edge it attaches to. |
hero | React.ReactNode | — | Fixed header content — a hero title or avatar + metadata. |
hue | "rose" | "orange" | "amber" | "green" | "teal" | "blue" | "violet" | "magenta" | — | A categorical identity: the hero header takes the hue's tint and the current link, focus and accents follow the hue. |
headerExtra | React.ReactNode | — | Extra header content below the hero (e.g. a search field or CTA). |
sections | SidebarSection[] | SidebarNavItem[] | Yes | Nav sections (divided); a bare item array is treated as one section. |
user | SidebarUser | — | Fixed footer user chip + optional pop-up menu. |
footerActions | SidebarFooterAction[] | — | Direct actions pinned in the fixed footer, above (or instead of) the user chip — one tap, no pop-up. |
footerActionsLayout | "list" | "row" | — | "list" (stacked rows, default) or "row" (side by side). They stack in the icon rail. |
footerActionsLabel | string | — | Names the footer-actions group for screen readers. Default "Quick actions". |
isCollapsed | boolean | — | Controlled: collapsed to an icon rail (hides labels, keeps icons). Leave undefined for uncontrolled. |
defaultCollapsed | boolean | — | Uncontrolled starting state. Default false. |
onCollapsedChange | (collapsed: boolean) => void | — | Fired by the collapse toggle with the next state. |
collapsible | boolean | — | Show a collapse/expand toggle under the nav. |
collapseBelow | "desktop" | "tablet" | — | Fold to the icon rail below this size tier: "desktop" (< 1024px) or "tablet" (< 640px). CSS-only, no flash on load. |
linkComponent | LinkComponent | — | Overrides LinkProvider's link component for this sidebar's links. |
ariaLabel | string | — | |
className | string | — |