This page as markdown: /side-nav.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

SideNav

Status: stable

A lightweight in-content vertical navigation list - the settings / docs sub-nav, distinct from the app-chrome Sidebar. Router-agnostic items, optional SideNavGroup sections, and an explicit active-state vocabulary for content rails or sidebar chrome.

Keywords: side nav, navigation, settings nav, sidebar, rail, docs nav, active item, group

Usage

Use SideNav for vertical navigation inside a settings page, documentation area, dashboard rail, or sidebar chrome. It is router-agnostic: compose items with render={} and choose activeVariant based on whether the nav sits in content or app chrome.

Best practices

Anatomy

Part Required Description
Nav yes The landmark container for the vertical navigation list.
Group no Optional labelled cluster of related navigation items.
Item yes Interactive row with label, optional icon, optional badge, and active state.
Badge no Trailing count or state indicator aligned to the row end.

Subcomponents

Name Type Description
SideNavItem { label: ReactNode; icon?: ReactNode; active?: boolean; badge?: ReactNode; size?: "md" | "lg"; activeVariant?: "content" | "sidebar"; render?: useRender.RenderProp } + button props A single row. label is the row text; icon is an optional leading icon; active marks the current sub-section (active fill + aria-current="page"); badge is a trailing node (e.g. a count) pushed to the row end; size and activeVariant override the enclosing SideNav per item; render composes another element, e.g. render={}.
SideNavGroup { label?: ReactNode } + div props A labelled section within a SideNav - groups settings into areas. label renders an optional sentence-case caption heading above the group's items.

Props

Name Type Default Description
size "md" | "lg" — Density shared by all items. "md" (default) = the lightweight in-content sub-nav; "lg" = chrome-weight (larger label + icon, roomier rows) for a rail that pairs with the app Sidebar.
activeVariant "content" | "sidebar" "content" Active-state token vocabulary shared by all items. "content" uses bg-accent/text-accent-foreground for local rails inside the content area; "sidebar" uses bg-sidebar-accent/text-sidebar-accent-foreground for SideNavs rendered inside app chrome.
motion "full" | "subtle" | "off" "full" How much motion this component uses: full inherits the app's policy, subtle keeps feedback and drops the current-page glide, off stills it. It can only turn motion down — it never overrides a reader's reduce-motion setting.

Tokens used

muted, muted-foreground, foreground, accent, accent-foreground, ring, sidebar-foreground, sidebar-accent, sidebar-accent-foreground, sidebar-ring

Motion

Accessibility

Related

Examples

Settings sub-nav

import { SideNav, SideNavItem } from "@sableui/react"
// <Link> = your router's link (react-router, next/link, @tanstack/router, …)

<SideNav><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Account" render={<Link to="/settings/account" />} /><SideNavItem label="Notifications" render={<Link to="/settings/notifications" />} /></SideNav>

Grouped

import { SideNav, SideNavGroup, SideNavItem } from "@sableui/react"
// <Link> = your router's link (react-router, next/link, @tanstack/router, …)

<SideNav><SideNavGroup label="Account"><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Security" render={<Link to="/settings/security" />} /></SideNavGroup><SideNavGroup label="Workspace"><SideNavItem label="Members" render={<Link to="/settings/members" />} /></SideNavGroup></SideNav>

Chrome-weight rail (size=lg)

import { SideNav, SideNavItem } from "@sableui/react"
// <Link> = your router's link (react-router, next/link, @tanstack/router, …)

<SideNav size="lg"><SideNavItem label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem label="Billing" render={<Link to="/settings/billing" />} /><SideNavItem label="Security" render={<Link to="/settings/security" />} /></SideNav>

Inside Sidebar chrome

import { SideNav, SideNavItem } from "@sableui/react"
// <Link> = your router's link (react-router, next/link, @tanstack/router, …)

<SideNav size="lg" activeVariant="sidebar"><SideNavItem label="Overview" active render={<Link to="/" />} /><SideNavItem label="Reports" render={<Link to="/reports" />} /><SideNavItem label="Settings" render={<Link to="/settings" />} /></SideNav>

Grouped with icons and badges

import { Badge, Icon, SideNav, SideNavGroup, SideNavItem } from "@sableui/react"
// <Link> = your router's link (react-router, next/link, @tanstack/router, …)

<SideNav aria-label="Settings sections"><SideNavGroup label="Account"><SideNavItem icon={<Icon name="user" />} label="Profile" active render={<Link to="/settings/profile" />} /><SideNavItem icon={<Icon name="lock" />} label="Security" badge={<Badge tone="warning" size="sm">2</Badge>} render={<Link to="/settings/security" />} /></SideNavGroup><SideNavGroup label="Workspace"><SideNavItem icon={<Icon name="bell" />} label="Notifications" render={<Link to="/settings/notifications" />} /></SideNavGroup></SideNav>