[!NOTE] Compound component — an opinionated composition of Helix primitives. Composes:
Sidebar,Collapsible.
Import
import { AppSidebar, AppSidebarOrgContext, AppSidebarHelpItem } from "@timelycare/helix-ui"
Requires the
AppShellwrapper — see its page for the composition.
Usage
<AppSidebar
brand={<Logo />}
items={[
{ type: "link", id: "home", label: "Home", icon: <Home />, href: "/" },
{ type: "link", id: "members", label: "Members", icon: <Users />, href: "/members" },
{
type: "group",
id: "visits",
label: "Visits",
icon: <Calendar />,
children: [
{ type: "link", id: "queue", label: "Queue", href: "/visits/queue" },
{ type: "link", id: "scheduled", label: "Scheduled", href: "/visits/scheduled" },
],
},
]}
pathname={pathname}
onItemClick={(id) => router.push(routes[id])}
/>
Active state & navigation
Pass pathname (the current route) and AppSidebar resolves the active item and its owning section itself — section-aware and most-specific, so nested and sibling detail routes (e.g. /clients/1074, a sibling of the /clients/list leaf) still highlight their section. Set match on an item when its route area differs from its href. Collapsible groups tidy on navigation: only the group owning the current route stays open after a route change, so the nav never accumulates a pile of open groups. activeItemId remains supported and overrides the derived leaf.