Getting Started
Foundations
Components
Search for a command to run...
SidebarProvider wraps the entire layout and provides state management for sidebar open/close behavior, responsive mobile handling, keyboard shortcuts (Cmd/Ctrl+B), and cookie-based state persistence. All sidebar components must be descendants of this provider to access sidebar context.
import { Sidebar } from "@strongtie/design-system/sidebar"This module exports the following components:
SidebarProviderSidebarSidebarTriggerSidebarRailSidebarInsetSidebarInputSidebarHeaderSidebarFooterSidebarSeparatorSidebarContentSidebarGroupSidebarGroupLabelSidebarGroupActionSidebarGroupContentSidebarMenuSidebarMenuItemSidebarMenuButtonSidebarMenuActionSidebarMenuBadgeSidebarMenuSkeletonSidebarMenuSubSidebarMenuSubItemSidebarMenuSubButton<SidebarProvider>| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | - | |
onOpenChange | ((open: boolean) => void) | - | |
open | boolean | - |
<Sidebar>| Prop | Type | Default | Description |
|---|---|---|---|
collapsible | none | offcanvas | icon | - | |
side | left | right | - | |
variant | sidebar | floating | inset | - |
<SidebarTrigger>| Prop | Type | Default | Description |
|---|---|---|---|
size | "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | - | |
variant | "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | - |
<SidebarMenuButton>| Prop | Type | Default | Description |
|---|---|---|---|
isActive | boolean | - | |
size | "default" | "sm" | "lg" | null | - | |
tooltip | string | (TooltipContentProps & RefAttributes<HTMLDivElement>) | - | |
variant | "default" | "outline" | null | - |
<SidebarMenuAction>| Prop | Type | Default | Description |
|---|---|---|---|
showOnHover | boolean | - |
<SidebarMenuSkeleton>| Prop | Type | Default | Description |
|---|---|---|---|
showIcon | boolean | - |
<SidebarMenuSubButton>| Prop | Type | Default | Description |
|---|---|---|---|
isActive | boolean | - | |
size | sm | md | - |
Components can be styled using the className prop. The design system uses Tailwind CSS for styling.
CSS classes used by this component:
sidebarsidebar-contentsidebar-footersidebar-groupsidebar-group-actionsidebar-group-contentsidebar-group-labelsidebar-headersidebar-inputsidebar-insetsidebar-menusidebar-menu-actionsidebar-menu-badgesidebar-menu-buttonsidebar-menu-itemsidebar-menu-skeletonsidebar-menu-subsidebar-menu-sub-buttonsidebar-menu-sub-itemsidebar-providersidebar-railsidebar-separatorsidebar-triggerEnsure proper accessibility attributes are added when implementing this component.