Skip to content

Sidebar Tokens

Sidebar tokens are component-local CSS custom properties defined on .bambi-sidebar in sidebar.css. Override them globally for every sidebar or scope them to one navigation area.

.bambi-sidebar {
--bambi-sidebar-width: 18rem;
--bambi-sidebar-collapsed-width: 4rem;
}
.settings-layout .bambi-sidebar {
--bambi-sidebar-bg: var(--bambi-background);
}
TokenDefaultPurpose
--bambi-sidebar-width16remExpanded sidebar width
--bambi-sidebar-collapsed-width3.5remIcon-collapse width
--bambi-sidebar-transitionwidth 0.25s ease, transform 0.25s easeCollapse/offcanvas animation

collapsible="icon" uses --bambi-sidebar-collapsed-width when closed. collapsible="offcanvas" translates the full sidebar off-screen.

TokenDefaultPurpose
--bambi-sidebar-bgvar(--bambi-card)Sidebar background
--bambi-sidebar-fgvar(--bambi-card-foreground)Text and icon color
--bambi-sidebar-bordervar(--bambi-border)Side, section, and rail borders

Header, footer, group separators, and rail use --bambi-sidebar-border.

TokenDefaultPurpose
--bambi-sidebar-focus-ringvar(--bambi-state-focus-ring)Menu and rail focus outline color
--bambi-sidebar-focus-ring-widthvar(--bambi-state-focus-ring-width)Focus outline width
--bambi-sidebar-focus-ring-offsetvar(--bambi-state-focus-ring-offset)Focus outline offset

Sidebar also reads global tokens for spacing, typography, state opacity, and accent colors:

TokenUsed for
--bambi-space-*Header, footer, group, and item spacing
--bambi-text-xs / --bambi-text-smGroup label and item text
--bambi-font-weight-*Group label and active item weight
--bambi-accent / --bambi-accent-foregroundHover and active item colors
--bambi-state-disabled-opacityDisabled item opacity

The props/config-driven Sidebar API renders the same classes as compound markup: bambi-sidebar-header, bambi-sidebar-content, bambi-sidebar-group, bambi-sidebar-menu, bambi-sidebar-menu-button, bambi-sidebar-footer, and bambi-sidebar-rail.