Skip to content
SuperCoach

Components · Navigation

Sidebar

Beta

The app's main navigation.

SuperCoach
Coaching
  • 24
  • 3
Business
Coach Faisal

When to use

  • As coach-admin's main navigation between top-level areas: Dashboard, Clients, Programs, Nutrition, Messages, Payments, Settings.

When not to use

  • To switch views inside a page: use Tabs.
  • For filters or secondary settings: use a sheet or a side panel.

Anatomy

The preview shows every part: the header (product name), group labels ("Coaching", "Business"), menu items with an icon and a label, the active item, count badges at the end of an item, and the footer (the signed-in coach).

Variants

BehaviorWhen
ExpandedDesktop, from md. The default.
Collapsed to icons (collapsible="icon")When the coach collapses it (⌘B / Ctrl+B or the trigger); labels show as tooltips
SheetBelow md: opens from the start edge as a sheet
Static (collapsible="none")Embedded layouts and this preview

SuperCoach's sidebar is brand Black with the active item in Electric Green and black text, as in the logo tile. Coach uses neutral-900 with an orange active item. Switch the preview's theme to compare.

States

StateWhat changesToken
RestLight text on the sidebar colorbg-sidebar, text-sidebar-foreground
HoverLighter fillbg-sidebar-accent, text-sidebar-accent-foreground
Active (current page)Brand fill, dark textbg-sidebar-primary, text-sidebar-primary-foreground
Focus-visibleRing in the active colorring-sidebar-ring

The active state is changed from shadcn's grey sidebar-accent to sidebar-primary, because the tokens define the active item as the brand color ($nav-active-color).

Usage guidelines

  • 5 to 9 items, grouped by job ("Coaching", "Business"), in the order coaches use them.
  • Exactly one active item: the section of the current page.
  • Count badges only for things that need action (unread messages, pending clients), not totals.

Content guidelines

  • One-word nouns where possible: "Clients", "Programs", "Payments".
  • Group labels are short and plain: "Coaching", not "Coaching tools & features".

Accessibility

KeyDoes
TabMoves through the items
EnterOpens the item
⌘B / Ctrl+BCollapses or expands the sidebar
EscapeCloses the mobile sheet
  • Wrap it in <nav aria-label="Main"> in the app. The current item has aria-current="page", announced as "Clients, current page".
  • Count badges get an accessible label ("24 new"), not just the number.
  • Lime on black and orange on neutral-900 both pass contrast; see the matrix.

RTL

The sidebar sits on the right in RTL: the component picks its side from the direction (Radix useDirection) unless side is set. Item icons, labels and count badges follow start and end. This is a change from upstream, which always defaulted to the left.

Tokens used

Read from components/ui/sidebar.tsx at build time, so this list changes when the component does. Opacity modifiers such as /90 are shadcn hover and focus tints on top of the token.

Semantic color tokens used by this component
TokenUtilitiesSuperCoachCoach
--backgroundbg-backgroundwhitewhite
--sidebarbg-sidebarneutral-950neutral-900
--sidebar-accentbg-sidebar-accentneutral-800neutral-800
--sidebar-accent-foregroundtext-sidebar-accent-foregroundwhitewhite
--sidebar-borderborder-sidebar-border bg-sidebar-borderneutral-800neutral-700
--sidebar-foregroundtext-sidebar-foreground text-sidebar-foreground/70whitewhite
--sidebar-primarybg-sidebar-primarylime-300orange-500
--sidebar-primary-foregroundtext-sidebar-primary-foregroundneutral-950neutral-950
--sidebar-ringring-sidebar-ringlime-300orange-500
  • Layerz-(--z-sticky)
  • Motionduration-(--duration-base)
  • Motionease-standard
  • Opacityopacity-(--opacity-disabled)
  • Radiusrounded-lg
  • Radiusrounded-md
  • Radiusrounded-xl
  • Shadowshadow-sm
  • Typefont-medium
  • Typetext-sm
  • Typetext-xs

Props

<SidebarProvider>

Also takes every prop of <div>

SidebarProvider props
PropTypeDefault
defaultOpen?booleantrue
open?boolean—
onOpenChange?(open: boolean) => void—

<Sidebar>

Also takes every prop of <div>

Sidebar props
PropTypeDefault
side?"left" | "right"—
variant?"sidebar" | "floating" | "inset""sidebar"
collapsible?"offcanvas" | "icon" | "none""offcanvas"

<SidebarTrigger>

Also takes every prop of <Button>

No props of its own.

<SidebarGroupLabel>

Also takes every prop of <div>

SidebarGroupLabel props
PropTypeDefault
asChild?booleanfalse

<SidebarMenuButton>

Also takes every prop of <button>

SidebarMenuButton props
PropTypeDefault
variant"default" | "outline""default"
size"default" | "sm" | "lg""default"
asChild?booleanfalse
isActive?booleanfalse
tooltip?string | React.ComponentProps<typeof TooltipContent>—

<SidebarMenuBadge>

Also takes every prop of <div>

No props of its own.

Replaces in coach-admin

From the read-only audit of coach-admin: 100 style values, 129 uses.

coach-admin's sidebar is CoreUI's, with a navy-to-black gradient ($nav-color). The system uses one sidebar color per theme.

Classes and selectors

  • .nav-link27
  • .sidebar23
  • .nav-item8
  • .sidebar .nav-link .sidebar-todos-count-badge7
  • .sidebar .sidebar-nav5
  • .sidebar-minimized .sidebar .nav-item:hover > .nav-link, .si4
  • .sidebar .nav4
  • .sidebar-nav4
  • .sidebar .sidebar-minimizer4
  • .sidebar-close3
  • .sidebar-form .form-control3
  • .nav-dropdown.open3

SCSS variables in these styles

  • $sidebar-widthnot a color: spacing, size or layout
  • $navbar-heightnot a color: spacing, size or layout
  • $mobile-sidebar-widthnot a color: spacing, size or layout
  • $sidebar-minimized-widthnot a color: spacing, size or layout
  • $zindex-stickynot a color: spacing, size or layout
  • $nav-active-txt-colornot a color: spacing, size or layout
  • $sidebar-compact-widthnot a color: spacing, size or layout
  • $sidebar-colornot a color: spacing, size or layout
  • $nav-btn-colornot a color: spacing, size or layout
  • $border-radiusnot a color: spacing, size or layout
  • $body-colornot a color: spacing, size or layout
  • $text-mutednot a color: spacing, size or layout

Tabs, Layout, Brand.