Sidebar
Loading example…
Main navigation. Always visible when its app container is wide; an off-canvas drawer under
900 px of container width, inert while closed so it is not reachable by keyboard.
Render it inside AppShell: the container decides, never the viewport. Without an AppShell
it measures its parent element instead.
Import
Section titled “Import”import { Sidebar } from "@jcsoftdev/ui/shell";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/shell/sidebar.
<Sidebar groups={groups} ariaLabel="Navegación principal" header={header} footer={footer} open={false}/>| Prop | Type | Default | Description |
|---|---|---|---|
groups * |
SidebarGroup[] |
||
ariaLabel * |
string |
Accessible name of the sidebar landmark. | |
header |
ReactNode |
Brand block shown at the top. | |
footer |
ReactNode |
Block pinned to the bottom (e.g. the current user). | |
renderLink |
SidebarRenderLink |
defaultRenderLink |
Link renderer; defaults to a plain anchor. |
open |
boolean |
false |
Drawer state when the app container is under 900 px. Ignored above it, where the sidebar is always visible. |
onClose |
(() => void) |
||
collapsed |
boolean |
false |
Icons-only rail with the labels as tooltips. Ignored while the sidebar is a drawer. |
className |
string |
||
style |
CSSProperties |
Inline style of the root (for example liquidStyle() options). |
|
material |
"solid" | "glass" | "glass-clear" | "liquid" | "liquid-clear" |
Surface material. Omitted keeps the default for this layer (opaque, glass in the glass preset); "glass" and "glass-clear" are frosted glass, "liquid" and "liquid-clear" Liquid Glass, "solid" forces opaque. Liquid options go in style (`liquidStyle(… |
|
classNames |
Partial<Record<SidebarPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last. |
* marks a required prop.
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/shell/sidebar/sidebar.tsx