Skip to main content

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 bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
side"left" | "right"—Which edge it attaches to.
heroReact.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.
headerExtraReact.ReactNode—Extra header content below the hero (e.g. a search field or CTA).
sectionsSidebarSection[] | SidebarNavItem[]YesNav sections (divided); a bare item array is treated as one section.
userSidebarUser—Fixed footer user chip + optional pop-up menu.
footerActionsSidebarFooterAction[]—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.
footerActionsLabelstring—Names the footer-actions group for screen readers. Default "Quick actions".
isCollapsedboolean—Controlled: collapsed to an icon rail (hides labels, keeps icons). Leave undefined for uncontrolled.
defaultCollapsedboolean—Uncontrolled starting state. Default false.
onCollapsedChange(collapsed: boolean) => void—Fired by the collapse toggle with the next state.
collapsibleboolean—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.
linkComponentLinkComponent—Overrides LinkProvider's link component for this sidebar's links.
ariaLabelstring—
classNamestring—