Skip to Content

Sidebar

Sectioned admin navigation. Items either navigate (href) or report selection via onSelect(key). Pairs with AppShell.

import { Sidebar } from '@gg-software/ui'; <Sidebar activeKey={active} onSelect={(key) => setActive(key)} sections={[ { title: 'Shop', items: [ { key: 'orders', label: 'Orders', icon: <OrdersIcon /> }, { key: 'products', label: 'Products', href: '/products' }, ], }, ]} collapsed={isCollapsed} />;

Props

PropTypeDefaultDescription
sections*SidebarSection[]
activeKeystring
onSelect((key: string) => void)
collapsedbooleanfalse
classNamestring

* required · generated from packages/ui/src/navigation/Sidebar/Sidebar.tsx

Types

type SidebarSection = { title?: ReactNode; items: SidebarItem[]; }; type SidebarItem = { key: string; label: ReactNode; icon?: ReactNode; href?: string; };