bloxa

Sidebar

FREE

App 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/sidebar

Examples

App layout

home
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

PropTypeDefaultDescription
defaultExpandedbooleantrueStart expanded on desktop.
hotkeystring | false"b"Toggle key with ⌘/Ctrl.
storageKeystring | null"bloxa-sidebar"Remember the state.
mobileQuerystring"(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.

PropTypeDefaultDescription
collapsible"icon" | "none""icon"Whether it can collapse to an icon rail.
widthstring"16rem"Expanded width.