Skip to main content

Sidebar

A full-featured collapsible sidebar with compound components, mobile Sheet support, nested items, search filtering, badges, and multiple visual variants.

Installation

$ npx shadcn@latest add @orecus/sidebar
Dependencies:
motionlucide-react
Registry:
sheetinput-groupbuttonseparator@orecus/enhanced-button@orecus/card@orecus/color-utils

Component

Glass Types

The type prop controls the glass effect intensity

Normal Glass
Inverted Glass

Layout Variants

The variant prop controls positioning and styling

Floating

Inline

Fixed

Border Radius

The radius prop controls corner rounding

Border

The border prop shows/hides the border

Props

PropTypeDefaultDescription
variant'floating' | 'fixed' | 'inline''floating'Visual style variant
type'normal' | 'subtle' | 'strong' | 'solid' | 'none''normal'Glass type for styling
invertbooleanfalseInvert glass overlay (white-on-light, dark-on-dark)
radius'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'Border radius size
borderbooleantrueShow border around sidebar (variant-aware: all sides for floating, right side only for fixed/inline)
collapsiblebooleanfalseEnable collapse to icons mode
defaultCollapsedbooleanfalseInitial collapsed state
collapsedboolean—Controlled collapsed state
onCollapsedChange(collapsed: boolean) => void—Callback when collapsed state changes
mobileBreakpoint'sm' | 'md' | 'lg''lg'When to show mobile drawer
widthnumber256Width in pixels
collapsedWidthnumber64Width when collapsed
activePathstring—Current active path for highlighting
activeStyle'background' | 'accentBar' | 'underline' | 'text''background'Active item styling variant
accentColorThemeColor'primary'Accent color for active items
accentPosition'left' | 'right''left'Position of accent bar
hoverEffect'none' | 'scale' | 'glow' | 'scale-glow' | 'translate''none'Hover animation effect for items
classNamestring—Additional CSS classes

Compound Components

Sidebar.Header

The header container.

PropTypeDefaultDescription
childrenReactNode—Header content
classNamestring—Additional CSS classes

Sidebar.Content

The scrollable content area.

PropTypeDefaultDescription
childrenReactNode—Sidebar items and groups
classNamestring—Additional CSS classes

Sidebar.Footer

The footer container.

PropTypeDefaultDescription
childrenReactNode—Footer content
classNamestring—Additional CSS classes

Sidebar.Group

A grouping of sidebar items with optional borders and collapse behavior.

PropTypeDefaultDescription
titlestring—Group title
iconLucideIcon | ReactNode—Group icon
collapsibleboolean—Whether group can be collapsed
defaultOpenbooleantrueInitial open state for collapsible groups
showItemBorderbooleanfalseShow left border on items within the group (like nested SubItems have)
showGroupBorderbooleantrueShow bottom border below the group header
childrenReactNode—Sidebar items
classNamestring—Additional CSS classes

Sidebar.Item

An interactive sidebar item.

PropTypeDefaultDescription
hrefstring—Navigation link URL
childrenReactNode—Item content (Label, Icon, Action)
activeboolean—Active state
disabledboolean—Disabled state

Sidebar.Label

Animated text label for an item.

PropTypeDefaultDescription
childrenReactNode—Label text

Sidebar.Icon

Icon wrapper for an item.

PropTypeDefaultDescription
childrenReactNode—Icon element

Sidebar.Action

Trailing action for an item.

PropTypeDefaultDescription
childrenReactNode—Action element

Sidebar.SubItems

Container for nested sub-items with optional left border.

PropTypeDefaultDescription
childrenReactNode—Sub-item elements
showItemBorderbooleantrueShow left border on sub-items
classNamestring—Additional CSS classes

Sidebar.Separator

A visual divider between groups or sections.

PropTypeDefaultDescription
classNamestring—Additional CSS classes