DocsNav
Docs and catalog sidebar only: title, grouped text-only links, optional decorative icons and muted counts on group and subgroup headers only, an active page pill and optional footer links.
Product side nav with a brand header and icon items that closes to an icon rail.
Product app chrome side navigation. DocsNav is the docs catalog nav only. Drawer is the overlay panel.
Brand mark, icon items, counts, and a closeable rail. Stays in the layout.
Workspace overview for the current team.
Put SideNav next to the page. Pass groups of icon items with optional badges. The panel icon closes. The brand mark reopens. Rail corners use radius-surface-md. Item hover, active, and focus fills use radius-control-md. When AppHeader already provides brand, pass showHeader={false} and radius="none" so the column sits flush. Use DocsNav for a docs catalog. Use Drawer for a temporary overlay panel.
A badge of digits renders as a kit Count. A parent with children is a disclosure with a chevron and never takes the page-active fill; the current leaf does. Pass expanded and onExpandedChange to control it. Arrow Down and Up move through the visible rows, Right opens a parent and Left closes it.
Override on :root, a wrapper, or the component's className / style, e.g. .myNav { --sidenav-width: var(--layout-rail); }. Set them to semantic tokens, never hex. Listed under cssVars in the contract.
| Variable | Controls (default) |
|---|---|
--sidenav-width | Open width of the rail and its inner panel (layout-sidebar) |
--sidenav-width-collapsed | Closed rail width (layout-sidebar-compact). AppHeader's brand column follows it unless --appheader-brand-width is set, so set it on :root to move both |
--sidenav-background | Panel background (surface-card) |
--sidenav-divider | Rule on the inline end of a flush rail (radius none), a border shorthand: default border-divider solid border-faint. none for a nav on the canvas (layout-shell--inset sets it) |
--sidenav-item-padding | Row padding; sets row height and the closed-rail icon chip (space-inset-sm) |
--sidenav-item-radius | Row and closed-rail chip corners (radius-control-md) |
--sidenav-item-gap | Gap between rows, top level and submenu (space-stack-2xs) |
--sidenav-item-hover-background | Row hover fill (surface-muted) |
--sidenav-item-active-background | Active row fill, closed-rail current chip and active text badge fill (bg-tray, a neutral grey; hover stays surface-muted) |
--sidenav-item-active-text | Active row text (text-primary) |
--sidenav-item-active-icon | Active row icon (icon-brand), so the current row is not marked by the fill alone |
--sidenav-group-label-color | Group label text (text-secondary) |
Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows). Preset props or compose your own from SideNav.Root/Header/Brand/Toggle/Nav/Section/Item/SubNav compose parts. Not DocsNav. Not an overlay itself: on small screens put it inside kit Drawer (the app-shell example shows one way).
import { SideNav } from "agentic-ds-kit";From contracts/sidenav.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| title | string | Yes | — | Brand title in the header. Accessible name on the aside when showHeader is false |
| mark | string | No | — | Brand letter. Defaults to the first character of title |
| markIcon | KitIcon | No | — | Icon mark instead of the letter, on the same brand fill: a Lucide name (e.g. Receipt), a Lucide component, or an element. Wins over mark. AppHeader takes the same prop. |
| markSurface | brand | none | No | brand | What the brand mark sits on; goes to SideNav.Brand. brand: the filled brand tile (fill-brand); use a letter, a Lucide name or an onBrand logo. none: the bare logo on the rail surface, no tile; use an element logo in brand colour (icon-brand). Same on the open and the closed rail. |
| showHeader | boolean | No | true | Brand mark, title, and close. Set false when AppHeader already provides brand. Rail open/close is controlled by `open`. |
| radius | md | none | No | md | Rail corners. md is radius-surface-md. none is a flush square column next to AppHeader. |
| variant | single | rail-subnav | No | single | single: one column that closes to an icon rail (open, defaultOpen, the Toggle). rail-subnav: the rail is always icons only (each row named in a kit Tooltip) and a parent row fills a SideNav.SubNav column beside it with its nested rows, instead of a disclosure or flyout. Until the user picks, the parent holding the current page fills it; picking the open parent again empties it and the column leaves the layout. open, defaultOpen, onOpenChange and the Toggle are ignored, the brand mark is not a control, and beforeGroups / afterGroups are faded and inert as on the closed rail. Inside a kit Drawer it is always single (expanded, parents are disclosures). |
| open | boolean | No | — | controlled |
| defaultOpen | boolean | No | true | — |
| onOpenChange | function | No | — | (open: boolean) => void |
| side | left | right | No | left | Does not position SideNav. The consumer shell uses row-reverse for right |
| groups | array | No | — | SideNavGroup[]: { label, items: SideNavItemData[] }. Takes precedence over items |
| items | array | No | — | SideNavItemData[] (id, label, href, onClick, icon, active, disabled, badge, items). badge: digits (e.g. "3") render as a kit Count (neutral subtle, brand subtle on the active row) and join the closed-rail tooltip; other text (e.g. "Online") renders as a kit Badge (soft, neutral, sm). icon: a curated Lucide name (any other name needs import "agentic-ds-kit/icons-on-demand") or a Lucide component (client code only; from a Server Component use a name). Flat list when groups is omitted. Leaf onClick is in-app select; href is a link when onClick is omitted. |
| footer | slot | No | — | SideNavItemData, SideNavItemData[] (e.g. Settings), or any ReactNode. For the signed-in user use account, not a hand-built card. |
| account | object | No | — | SideNav.Account props. Renders last in the footer, below the footer rows: kit Avatar (sm), name, secondary line (e.g. email), optional trailing tertiary icon Button named by action.label (e.g. Log out). presence puts kit Avatar's corner mark on the avatar; its word (KitLabels online, away, offline) joins the name for screen readers and the closed-rail tooltip (Olivia Rhye, Online). Long text truncates with the full text in the DOM and the hover title. |
| header | slot | No | — | Replaces the brand (mark + title) in the header. The preset keeps a SideNav.Toggle beside it: Close while open; on the closed rail the slot fades and goes inert and the Toggle moves to the start edge to reopen the rail. For a mark inside a custom header, build it from compose parts with SideNav.Brand. Ignored when showHeader is false. |
| beforeGroups | slot | No | — | Pinned above the scrolling groups, e.g. a workspace switcher. Faded, inert and collapsed to no height on the closed rail. |
| afterGroups | slot | No | — | Pinned below the scrolling groups, above the footer, e.g. a promo card. Faded, inert and collapsed to no height on the closed rail. |
| renderItem | function | No | — | (item, defaultNode) => ReactNode. Customise one row. defaultNode is the kit link or button with aria-current and disclosure attributes: wrap it, put content beside it, or cloneElement it with new children. Keep it in the tree. Applies to nested and footer rows too. |
Docs and catalog sidebar only: title, grouped text-only links, optional decorative icons and muted counts on group and subgroup headers only, an active page pill and optional footer links.
Edge panel for secondary tasks.
Dismissible overlay for short tasks, forms, or extra detail.
Horizontal site nav.