Sidebar

NEW

A collapsible application sidebar with a hover pill that follows the cursor and a shared-layout active pill that glides between items. Includes nested sections, icon-only mode with tooltips, ⌘B toggle, and a draggable mobile drawer.

Press ⌘B to collapse — or shrink the window for the mobile drawer.

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/sidebar

API Reference

PropTypeDefaultDescription
sectionsSidebarSection[]undefinedNavigation sections with items, optional titles, badges, and nested children
activeIdstringundefinedID of the active item
onActiveChange(id: string) => voidundefinedCalled when an item or child is selected
headerReact.ReactNodeundefinedBrand/header slot (use useSidebar() to adapt when collapsed)
footerReact.ReactNodeundefinedFooter slot above the collapse toggle
collapsedbooleanundefinedControlled collapsed (icon-only) state
defaultCollapsedbooleanfalseInitial collapsed state (uncontrolled)
onCollapsedChange(collapsed: boolean) => voidundefinedCollapse state change callback
mobileOpenbooleanundefinedControlled mobile drawer open state
onMobileOpenChange(open: boolean) => voidundefinedMobile drawer open state callback
classNamestringundefinedAdditional class for the aside