Sidebar

1. Left Navigation Sidenav (side='left', variant='collapsible')

>npx @shavin/ui add sidebar

2. Right Property Inspector Panel (side='right')

>npx @shavin/ui add sidebar

3. Drag-Resizable Rail (resizable={true})

>npx @shavin/ui add sidebar

4. Floating Card Variant (variant='floating')

>npx @shavin/ui add sidebar

5. Inset Panel Variant (variant='inset')

>npx @shavin/ui add sidebar

Compound Components & Sub-Component API Documentation

1. <Sidebar> Root Container

Root panel primitive managing context state (`side`, `variant`, `collapsed`, `resizable`).

PropTypeDefaultDescription
side"left" | "right"leftSidebar dock side: "left" (Sidenav, left panel) or "right" (Configurator, Inspector). Default "left".
variant"fixed" | "collapsible" | "floating" | "inset"fixedSidebar visual variant: fixed width, collapsible rail, floating card, or inset panel. Default "fixed".
collapsibleMode"icon" | "offcanvas" | "none"iconCollapsible mode: "icon" rail collapse, "offcanvas" full hide, or "none". Default "icon".
collapsedboolean—Controlled collapsed state.
onCollapsedChange(collapsed: boolean) => void—Callback fired when collapsed state changes.
defaultCollapsedbooleancollapsedInitial default collapsed state.
widthstringw-60Custom width CSS string (e.g. "w-60", "w-72", "w-80"). Default "w-60".
resizablebooleanfalseEnable interactive drag resizability. Default false.
minWidthnumber180Minimum width in pixels when resizable. Default 180.
maxWidthnumber420Maximum width in pixels when resizable. Default 420.
childrenReactNode—Custom sidebar content.
classNamestring—Custom root class name.

2. <SidebarTrigger> Toggle Button

Auto-wires click handler to toggle parent <Sidebar> collapse state, rendering PanelLeft or PanelRight icon matching side.

SidebarTrigger takes no props beyond className and the native element's attributes.

3. <SidebarHeader> Top Section

Header top bar wrapper for logo, title, and collapse triggers. Automatically centers content when collapsed.

SidebarHeader takes no props beyond className and the native element's attributes.

4. <SidebarBody> Scrollable Content

Scrollable main body container (`flex-1 overflow-y-auto pg-scroll`) holding sections and items.

SidebarBody takes no props beyond className and the native element's attributes.

5. <SidebarSection> Group Container

Logical section container with an optional uppercase title label. Automatically hides title when collapsed.

PropTypeDefault
titlestring—

6. <SidebarNavItem> Navigation Rail Item

Specialized navigation item button/link that automatically reacts to collapse state (hides text label and renders a hover Tooltip when collapsed).

PropTypeDefault
iconReactNode—
label*string—
activeboolean—
badgeReactNode—
hrefstring—
onClick() => void—
classNamestring—

* required

7. <SidebarFooter> Bottom Section

Footer container for user avatar, settings trigger, or profile info.

SidebarFooter takes no props beyond className and the native element's attributes.

Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font