Components · Navigation
Sidebar
StableAdded v0.0.1
Vertical app navigation: a header, grouped items with icons, and a pinned footer. Collapses to icons.
import { Sidebar } from '@nexub/react';Playground
Props
<Sidebar.Root aria-label="Workspace" className="rounded-shape-container">…</Sidebar.Root>Examples
Default
Collapsed
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| collapsed | boolean | — | Icon-only width. Labels stay for screen readers and show as a native tooltip. |
| aria-label | string | — | Name of the nav landmark. Defaults to the localised "Sidebar". |
| SidebarHeader status | React.ReactNode | — | Trailing element next to the logo (Sidebar.Header children), e.g. a Badge. Moves under the logo when they don’t fit. |
| SidebarGroup label | string | — | Heading above a group of items. |
| SidebarItem icon | React.ReactNode | — | Leading icon; the only thing shown when collapsed. |
| SidebarItem active | boolean | — | Marks the current page (aria-current="page"). |
| SidebarItem asChild | boolean | — | Use your router <Link> as the item; pass it as the only child. |
| Sidebar.Separator / Footer | compound | — | A divider, and a footer that stays pinned while the items scroll. |
| accent | 'leap' | 'bookub' | 'payub' | 'founderub' | 'people' | 'contracts' | 'forms' | 'commerce' | 'money' | 'capital' | 'mind' | 'go' | 'command-hub' | 'runner' | 'book-hub' | 'payhub' | 'founder-hub' | 'os' | 'fintech' | 'intelligence' | 'autonomous' | — | 10.3: the app or division this sidebar belongs to. Sets data-product / data-division, so the active item takes that accent (needs @nexub/themes/products or /divisions). |
| collapseBelow | 'sm' | 'md' | 'lg' | — | 10.6: collapse to the icon rail below this breakpoint (when collapsed is not passed). |
On iOS & Android
Web only
Sidebar has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.