Skip to documentation

Design system / Organisms

Organism / Navigation and discovery

SidebarNav

SidebarNav presents supplied destinations with optional independent section disclosure and one-level item folders.

NavigationOrganism

Intent and composition

Buttons disclose sections or folders; native links open destinations. ConsoleShell supplies sectionExpansion from useSidebarPreferences: groups default collapsed and retain independent browser-local choices across navigation and reloads. Tenant namespaces and stable group IDs separate choices; labels never become storage keys. Active destinations do not override saved choices. Invalid or unavailable storage falls back to collapsed/in-memory disclosure. Without sectionExpansion, the generic organism retains transient expanded sections and active-section revelation. Optional folders remain local. Next Link owns pending navigation; same-size indicators avoid row shifts. This is ordinary navigation, not an ARIA tree. Preferences never authorize access.

Coordinated concerns: Optional section headings/disclosure, compact density, native links, one-level folders, controlled selection and independent expansion.

Receives an authorized hierarchy and optional sectionExpansion controller with isExpanded(id) and toggle(id). ConsoleShell binds tenant-scoped browser preferences; uncontrolled sections and generic folders retain transient state. The server supplies permitted resources. SidebarShell owns placement, mobile modality and the account slot.

Real component specimen

Actual compact SidebarNav and useSidebarPreferences in a fictional design-system browser namespace. Council Rounds, Awards Events and Administration start collapsed without saved choices. Toggle each and reload to inspect independent restoration. Local anchors send no tenant requests. The full-width shell specimen demonstrates the generic uncontrolled default, long navigation and the pinned account menu.

Live preview

Real component, fictional data. Interactive callbacks remain local.

Supported inputs and ownership

SidebarNav input summary
InputResponsibility
sectionsStable IDs, labels, optional overview links and authorized items. headingVariant=label preserves authored case. hideHeading removes the heading but retains its accessible name. collapsible adds aria-expanded/aria-controls; hidden links leave keyboard navigation. Defined item children optionally mark a folder.
sectionExpansionOptional controller with isExpanded(id): boolean, toggle(id): void and optional ready: boolean. ConsoleShell binds useSidebarPreferences to its tenant namespace. While ready=false, section controls are disabled and navigation is aria-busy; ordinary links and account controls remain available. Hydration applies saved choices before enabling disclosure. Selection never overrides controlled choices. Omission retains transient expanded sections with active-section revelation; folder disclosure is unchanged.
densityDefault retains text-md and 44px minimum rows. Compact retains text-label, with 32px minimum fine-pointer rows, smaller icon slots, tighter gaps and indented existing groups. Coarse pointers retain 44px targets. No font, colour, scale or rhythm change.
section.actionIndependent destination with id, label, href, optional icon and isCurrent. It follows items and emptyLabel inside the collapsible content. Availability and labels belong to the caller.
isCurrent / isAncestorSupplied URL selection. Only exact destinations receive aria-current=page.
onNavigate(href)Next Link supplies the destination during client navigation. The owner chooses dismissal policy; disclosure does not call it. ConsoleShell skips dismissal for Catalogue because that route unmounts the drawer and must preserve its saved visibility. Other destinations retain ordinary mobile dismissal.
aria-label / classNameLandmark name and outer placement. The organism owns row, focus, selection and disclosure styles.

This is an integration summary, not a replacement for the implementation's complete prop types. A disabled control or hidden destination does not enforce permission.

Using it in a page

Integrate the section through its supported props and context requirements. Routes supply permitted data; instances bind product copy and behavior; templates arrange slots. Keep feature hooks and operations with their feature owner. Generic layouts must not load business data or enforce product policy.

Implementation

Repository path: src/components/navigation/sidebarNav.tsx

All organisms
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.