Layout/Sidebar

Sidebar

A vertical navigation sidebar. Renders as a static column on desktop and collapses into an off-canvas overlay panel below the md: breakpoint.

import { Sidebar, SidebarItem } from "@animui/ui"

Basic

Resize below the md: breakpoint (or view on a small screen) to see it collapse into an overlay opened by the hamburger button.

Dashboard
Content for Dashboard goes here.

Sidebar props

PropTypeDefaultDescription
childrenReact.ReactNodeSidebar content, typically a header and SidebarItem rows.
openbooleanfalseControls the off-canvas panel visibility on mobile (below md:).
onOpenChange(open: boolean) => voidCalled when the mobile panel should open or close (backdrop click, Escape, item click).
classNamestringAdditional classes applied to the sidebar panel.

SidebarItem props

PropTypeDefaultDescription
iconReact.ReactNodeIcon rendered before the label.
childrenReact.ReactNodeThe item label. Truncated if it overflows.
activebooleanfalseHighlights the item as the current page.
onClick() => voidCalled when the item is clicked.
classNamestringAdditional classes for the item button.

Accessibility

  • Active items expose aria-current="page".
  • Pressing Escape closes the mobile overlay.
  • Background scrolling is locked while the mobile overlay is open.
© 2026 Steal Shadow. MIT License.Report an issue