Sidebar
FREEApp sidebar that collapses to an icon rail on desktop (⌘B) and becomes a left drawer on mobile.
Installation
Terminal
npx @bloxa/cli add sidebar
# or: npx shadcn@latest add @bloxa/sidebarExamples
App layout
Collapse the sidebar to an icon rail; hover icons for labels. On a phone it opens as a drawer.
API reference
Every component also accepts the props of the element it renders.
SidebarProvider
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultExpanded | boolean | true | Start expanded on desktop. |
| hotkey | string | false | "b" | Toggle key with ⌘/Ctrl. |
| storageKey | string | null | "bloxa-sidebar" | Remember the state. |
| mobileQuery | string | "(max-width: 767px)" | Media query where it becomes a drawer. |
Sidebar
Use with SidebarHeader, SidebarContent, SidebarFooter and SidebarTrigger; put a NavMenu inside. useSidebar() exposes the state.
| Prop | Type | Default | Description |
|---|---|---|---|
| collapsible | "icon" | "none" | "icon" | Whether it can collapse to an icon rail. |
| width | string | "16rem" | Expanded width. |