AppSidebar
A composable, collapsible app sidebar with provider, nav groups, user card, and collapse button.
When to use
AppSidebar is the Platform's own sidebar component: a persistent, collapsible nav rail with a brand header, nav groups, a user card pinned to the bottom, and a collapse button that toggles to icon-only mode. It uses the --sidebar-* token group and integrates with react-i18next for labels.
Use it when you need the Platform app shell. For simpler navigation surfaces (command menus, menubars, or temporary sheets), use the corresponding shadcn/ui component instead.
Install
pnpm add @plainconceptsplatform/ui-componentsUsage
import {
AppSidebarProvider,
AppSidebar,
AppSidebarHeader,
AppSidebarBrand,
AppSidebarContent,
AppSidebarNav,
AppSidebarNavGroup,
AppSidebarNavItem,
AppSidebarSeparator,
AppSidebarFooter,
AppSidebarUserCard,
AppSidebarCollapseButton,
} from "@plainconceptsplatform/ui-components/app-sidebar";Components
AppSidebarProvider- Context provider that manages collapsed state and persists it tolocalStorage. Renders no element of its own, so it takes noclassName: wrap it in your own layout element. Must wrap the sidebar.AppSidebar- The<aside>container. Handles width transition and collapse.AppSidebarHeader- Top section for brand/logo.AppSidebarBrand- Brand text + logo combo.AppSidebarActions- Right side of the header, for icon buttons.AppSidebarIconButton- A single icon button. Takesiconand alabelused as the accessible name.AppSidebarContent- Middle scrollable section for nav.AppSidebarNav/AppSidebarNavGroup/AppSidebarNavItem- Nav list with groups and items (NavLink-compatible).AppSidebarSeparator- Horizontal divider between sections.AppSidebarSpacer- Pushes everything after it to the bottom.AppSidebarFooter- Bottom section, pinned.AppSidebarUserCard- Avatar + name + dropdown menu. Takesname,avatarand optionalsubtitleanddropdown.AppSidebarThemeToggle/AppSidebarUserMenuItem/AppSidebarUserMenuDivider- Pieces for the user card'sdropdown.AppSidebarCollapseButton- Toggle button that collapses to icon-only (64px) mode.expandIconandcollapseIconare required, so the icon set stays the consuming app's choice.
Marking the active item
AppSidebarNavItem takes isActive, not active. The wrong name is not a type error in
every setup and produces a sidebar where nothing is ever highlighted.
By default the icon follows the item's state, muted when inactive and the accent colour when
active. Pass iconClassName when the icon carries its own meaning (a colour shared by every
AI feature, say) and it keeps that colour in both states.
<AppSidebarNavItem
to="/ai/team-usage"
label="Team AI Usage"
icon={Sparkles}
iconClassName="text-violet-500"
isActive={pathname === "/ai/team-usage"}
/>