Skip to content

    Sidebar

    App shell navigation beside the page: a column of sections and items from the start edge, with a trigger that collapses it to a rail of icons (each named by a Tooltip) or hides it. Below the md breakpoint the same content opens in a Sheet. The optional panel variant adds a brand header with an internal toggle and nested navigation groups. With inset, the column sits on the sunken canvas and SidebarInset holds the page content in one page-filled panel.

    Preview

    Workspace

    Overview

    Your content appears here.

    Props

    • collapsed
    • defaultCollapsed
    • collapsible
    • side
    • label
    • active
    • asChild
    • href
    • count
    • disabled
    • variant
    • name
    • open
    • defaultOpen
    • value
    • defaultValue
    • inset
    • sheetTitle
    import { IconChartLine, IconHome, IconHomeFilled, IconSettings, IconUser } from "@tabler/icons-react"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider side="left" collapsible="icon" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>

    Usage

    When to use

    • Top-level navigation that stays beside the page across a whole product.
    • A long list of destinations grouped into named sections.

    When not to use

    • Switching between views of the same content. Use Tabs.
    • A short list of actions anchored to a control. Use DropdownMenu.
    • One optional section on a page. Use Accordion.

    Variants

    collapsible

    Set on SidebarProvider. icon keeps a rail of icons with Tooltips when collapsed; offcanvas hides the sidebar on desktop entirely without SidebarBrand, or keeps the internal recovery toggle with it; none fixes it open.

    • Workspace

      Overview

      Your content appears here.

      icondefault

    • Workspace

      Overview

      Your content appears here.

      offcanvas

    • Workspace

      Overview

      Your content appears here.

      none

    import { IconChartLine, IconHome, IconHomeFilled, IconSettings, IconUser } from "@tabler/icons-react"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider side="left" collapsible="icon" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>
    <SidebarProvider side="left" collapsible="offcanvas" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>
    <SidebarProvider side="left" collapsible="none" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>

    side

    Set on SidebarProvider. The edge the sidebar sits on; the Sheet opens from the same edge.

    • Workspace

      Overview

      Your content appears here.

      leftdefault

    • Workspace

      Overview

      Your content appears here.

      right

    import { IconChartLine, IconHome, IconHomeFilled, IconSettings, IconUser } from "@tabler/icons-react"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider side="left" collapsible="icon" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>
    <SidebarProvider side="right" collapsible="icon" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="order-2 h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>

    variant

    Set on Sidebar. default keeps the flat navigation example; panel adds nested groups. With SidebarBrand, both variants keep the toggle inside the header, replacing the logo on the collapsed or mobile rail.

    • Workspace

      Overview

      Your content appears here.

      defaultDefaultdefault

    • Workspace

      Overview

      Your content appears here.

      panelPanel with logo

    import { IconChartLine, IconHome, IconHomeFilled, IconLayoutGrid, IconList, IconSettings, IconTag, IconUser } from "@tabler/icons-react"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider side="left" collapsible="icon" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="profile" leadingIcon={<IconUser size={20} />}>Profile</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>
    <SidebarProvider side="left" defaultValue="overview">
      <div className="flex min-h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-surface">
        <Sidebar variant="panel" className="h-auto">
          <SidebarHeader className="border-b border-border">
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent className="[&_ul]:gap-sm">
            <SidebarSection>
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="activity" leadingIcon={<IconChartLine size={20} />}>Activity</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Workspace">
              <SidebarGroup label="Projects" leadingIcon={<IconLayoutGrid size={20} />} defaultOpen>
                <SidebarItem value="all-projects">All projects</SidebarItem>
                <SidebarItem value="recent-projects">Recent projects</SidebarItem>
                <SidebarItem value="archived-projects">Archived projects</SidebarItem>
              </SidebarGroup>
              <SidebarGroup label="Library" leadingIcon={<IconList size={20} />}>
                <SidebarItem value="documents">Documents</SidebarItem>
                <SidebarItem value="assets">Assets</SidebarItem>
              </SidebarGroup>
              <SidebarItem value="labels" leadingIcon={<IconTag size={20} />}>Labels</SidebarItem>
            </SidebarSection>
          </SidebarContent>
          <SidebarFooter>
            <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            <SidebarItem value="your-account" leadingIcon={<IconUser size={20} />}>Your account</SidebarItem>
          </SidebarFooter>
        </Sidebar>
        <div className="flex min-w-0 flex-1 flex-col gap-lg p-lg">
          <div className="flex flex-col gap-xs">
            <p className="text-xs text-text-secondary">Workspace</p>
            <p className="text-heading-3 text-text-primary">Overview</p>
          </div>
          <div className="flex flex-1 items-center justify-center rounded-container border border-border bg-background-surface p-md text-center text-sm text-text-secondary">Your content appears here.</div>
        </div>
      </div>
    </SidebarProvider>

    Examples

    App navigation

    Your content appears here.
    import { IconChartLine, IconHome, IconHomeFilled, IconSettings } from "@tabler/icons-react"
    import { Button } from "@/components/ui/button"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarFooter, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider defaultValue="overview">
      <div className="flex min-h-[32rem] w-full rounded-container border border-border">
        <Sidebar className="h-auto">
          <SidebarHeader>
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent>
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
            </SidebarSection>
            <SidebarSection label="Account">
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />} count={2}>Settings</SidebarItem>
            </SidebarSection>
          </SidebarContent>
          <SidebarFooter>
            <Button variant="secondary" className="w-full">Invite people</Button>
          </SidebarFooter>
        </Sidebar>
        <div className="flex min-w-0 flex-1 items-center justify-center p-md text-center text-sm text-text-secondary">Your content appears here.</div>
      </div>
    </SidebarProvider>

    Offcanvas with a trigger

    collapsible offcanvas hides the sidebar on desktop; the trigger toggles it and opens the Sheet on a small screen.

    import { IconLayoutGrid, IconLayoutGridFilled } from "@tabler/icons-react"
    import { Sidebar, SidebarContent, SidebarItem, SidebarProvider, SidebarSection, SidebarTrigger } from "@/components/ui/sidebar"
    
    <SidebarProvider defaultValue="projects" collapsible="offcanvas" defaultCollapsed>
      <SidebarTrigger label="Toggle navigation" />
      <Sidebar>
        <SidebarContent>
          <SidebarSection label="Menu">
            <SidebarItem value="projects" leadingIcon={<IconLayoutGrid size={20} />} leadingIconOn={<IconLayoutGridFilled size={20} />} active>Projects</SidebarItem>
          </SidebarSection>
        </SidebarContent>
      </Sidebar>
    </SidebarProvider>

    Panel with brand header

    The internal header toggle sits beside a placeholder logo. Nested groups expand in place; the compact rail and mobile sheet keep navigation accessible.

    import { IconHome, IconHomeFilled, IconLayoutGrid, IconSettings } from "@tabler/icons-react"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider defaultValue="overview">
      <Sidebar variant="panel">
        <SidebarHeader>
          <SidebarBrand name="Workspace" />
        </SidebarHeader>
        <SidebarContent>
          <SidebarSection label="Workspace">
            <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
            <SidebarGroup label="Projects" leadingIcon={<IconLayoutGrid size={20} />} defaultOpen>
              <SidebarItem value="all-projects">All projects</SidebarItem>
              <SidebarItem value="recent-projects">Recent projects</SidebarItem>
            </SidebarGroup>
          </SidebarSection>
        </SidebarContent>
        <SidebarFooter>
          <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
        </SidebarFooter>
      </Sidebar>
    </SidebarProvider>

    Inset layout

    The app layout: the Sidebar on the sunken canvas and the page content in one inset panel with 32px padding.

    Overview

    Revenue

    Last 30 days

    import { IconChartLine, IconHome, IconHomeFilled, IconSettings } from "@tabler/icons-react"
    import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
    import { Sidebar, SidebarBrand, SidebarContent, SidebarHeader, SidebarInset, SidebarItem, SidebarProvider, SidebarSection } from "@/components/ui/sidebar"
    
    <SidebarProvider defaultValue="overview">
      <div className="flex h-[32rem] w-full overflow-hidden rounded-container border border-border bg-background-sunken">
        <Sidebar inset className="h-auto">
          <SidebarHeader>
            <SidebarBrand name="Workspace" />
          </SidebarHeader>
          <SidebarContent>
            <SidebarSection label="Workspace">
              <SidebarItem value="overview" leadingIcon={<IconHome size={20} />} leadingIconOn={<IconHomeFilled size={20} />}>Overview</SidebarItem>
              <SidebarItem value="reports" leadingIcon={<IconChartLine size={20} />}>Reports</SidebarItem>
              <SidebarItem value="settings" leadingIcon={<IconSettings size={20} />}>Settings</SidebarItem>
            </SidebarSection>
          </SidebarContent>
        </Sidebar>
        <SidebarInset className="gap-2xl">
          <h1 className="text-heading-2">Overview</h1>
          <Card>
            <CardHeader>
              <CardTitle>Revenue</CardTitle>
              <CardDescription>Last 30 days</CardDescription>
            </CardHeader>
          </Card>
        </SidebarInset>
      </div>
    </SidebarProvider>

    Do and don't

    Do

    • Give every section a label; it names the nav and orients the reader.
    • Mark exactly one item active, the page the user is on.
    • Keep the footer for identity and account actions, not navigation.
    • Use SidebarBrand inside SidebarHeader in either variant so the toggle remains inside the sidebar.
    • Give every SidebarGroup a label and leading icon. Use nested SidebarItem links for destinations.
    • Use item values with SidebarProvider defaultValue for button destinations that select views without links. Use value and onValueChange when the application controls selection.
    • Keep submenu destinations in SidebarGroup so panel rails can expose them in a side flyout.
    • In an app, set inset on the Sidebar and put the page content in SidebarInset. Its padding is the page padding: don't pad the content again, and separate sections with gap-2xl.

    Don't

    • Don't switch between views of the same content; use Tabs.
    • Don't put controls other than items inside the content; put them in the header or footer.
    • Don't nest a sidebar inside a sidebar.
    • Do not use offcanvas without SidebarBrand unless an external opener remains accessible.
    • Don't put a Card around the whole page inside SidebarInset; it already is the panel. Cards inside it keep their surface fill and border.

    Props

    NameTypeValuesDefaultDescription
    collapsedboolean--Set on SidebarProvider. The collapsed state, when you control it. Pair it with onCollapsedChange.
    defaultCollapsedboolean-falseSet on SidebarProvider. Collapsed on first render.
    onCollapsedChangefunction--Set on SidebarProvider. Called with the next collapsed state.
    collapsibleenumicon | offcanvas | noneiconSet on SidebarProvider. icon keeps a rail of icons with Tooltips when collapsed; offcanvas hides the sidebar on desktop entirely without SidebarBrand, or keeps the internal recovery toggle with it; none fixes it open.
    sideenumleft | rightleftSet on SidebarProvider. The edge the sidebar sits on; the Sheet opens from the same edge.
    labelstring-MainSet on SidebarContent, the name of its navigation landmark; set on SidebarSection, the group's heading and name (hidden on the icon rail).
    activeboolean-falseSet on SidebarItem. The page this item points to: aria-current="page", the muted accent fill with its strong text, and the fill icon weight. When omitted on an item with value, selection comes from SidebarProvider. An explicit active prop overrides that item's selected state.
    asChildboolean-falseSet on SidebarItem. Renders the item as the single child element, typically a router link.
    hrefstring--Set on SidebarItem. With it the item is a link; without it a button.
    countnumber--Set on SidebarItem. A number after the label in a Badge; on the rail it moves into the Tooltip.
    leadingIconnode--Set on SidebarItem. The Tabler icon before the label, 20px.
    leadingIconOnnode--Set on SidebarItem. The filled-variant icon (Tabler *Filled, e.g. IconHomeFilled) shown on the active item instead of leadingIcon.
    disabledboolean-falseSet on SidebarItem. The item cannot activate and dims, including links and slotted router links. Disabled items leave the tab order; on the icon rail their Tooltip still opens on hover.
    variantenumdefault | paneldefaultSet on Sidebar. default keeps the flat navigation example; panel adds nested groups. With SidebarBrand, both variants keep the toggle inside the header, replacing the logo on the collapsed or mobile rail.
    name requiredstring--Set on SidebarBrand. The required workspace name, visually hidden on the rail.
    logonode--Set on SidebarBrand. A custom logo node; omitted, it shows a neutral placeholder.
    openboolean--Set on SidebarGroup. Controls the expanded sidebar's inline disclosure; pair with onOpenChange. The collapsed panel's transient hover flyout has independent state.
    defaultOpenboolean-falseSet on SidebarGroup. Starts the inline disclosure open. It does not open the collapsed panel flyout.
    onOpenChangefunction--Set on SidebarGroup. Called with the requested inline disclosure state. Transient panel flyout changes do not call it.
    valuestring--Set on SidebarProvider for controlled selection, paired with onValueChange. Set on SidebarItem to identify that destination. Activating an enabled item updates selection; href remains optional.
    defaultValuestring--Set on SidebarProvider. The initially selected item value when selection is uncontrolled.
    onValueChangefunction--Set on SidebarProvider. Called once when an enabled item requests a different selected value.
    insetboolean-falseSet on Sidebar. Puts the column on the sunken canvas with no visible edge, for an app layout where SidebarInset holds the page content. Independent of variant.
    sheetTitlestring-SidebarSet on Sidebar. Names the Sheet below md. Without a SidebarBrand it also shows beside the Sheet's close button, so the reader knows which menu is open.

    Slots

    NameRequiredDescription
    headernoSidebarHeader above the scrolling content.
    contentyesSidebarContent with one or more SidebarSection of SidebarItem.
    footernoSidebarFooter pinned at the end.
    insetnoSidebarInset beside the Sidebar, with the page content.

    Anatomy

    PartDescription
    rootSidebar: the desktop column, hidden below md, 256px wide, bordered only on the edge that faces the content. On the icon rail it is one square md item wide plus spacing-sm on each side (49px with the border on mouse, 53px on touch), and the header, content and footer pad with spacing-sm. With SidebarBrand, either variant uses one md control width on the rail and keeps a compact rail visible below md so the internal toggle remains accessible.
    headerSidebarHeader: the block above the scrolling content, such as the workspace name.
    contentSidebarContent: the scrolling group of sections, a nav named by its label (default "Main").
    footerSidebarFooter: the block pinned at the end, with a Separator above it.
    sectionSidebarSection: a group of related items, named by its label, with the items in a list.
    labelThe section heading: 12px medium secondary text, hidden on the icon rail.
    itemSidebarItem: one destination, a link with href, a button without one, or any element with asChild. At least the md control height, 14px medium text, a Badge after the label with count. Inline padding is spacing-sm, and grows with the corner up to half the row height so a pill cap does not cover the label. On the icon rail an item with an icon is a square of the md control height.
    currentThe active item, the page the user is on: the muted accent fill with its strong text.
    currentIconThe active item's icon in the accent icon color, at the fill weight.
    iconThe item's leading Tabler icon at 20px; leadingIconOn (the *Filled variant) replaces it on the active item.
    triggerSidebarTrigger: one ghost icon button that collapses the sidebar on md and up and opens the Sheet below it, named by its label. With collapsible none it shows only below md.
    brandSidebarBrand: a placeholder or supplied logo and the workspace name beside SidebarTrigger when expanded. On the rail the logo is removed and the toggle takes its place, aligned with the navigation icons. The logo returns when expanded, including in the mobile Sheet.
    groupSidebarGroup: a named disclosure button with a leading icon and caret, followed by a list of nested destinations. Its children hide on the rail; activating it expands the sidebar, or opens the mobile sheet. On a collapsed desktop panel, hover or activate its icon to open the destinations in a side flyout toward the page, without expanding the sidebar. The flyout reuses Popover positioning, collision handling and motion.
    insetSidebarInset: the page content beside an inset Sidebar, a main landmark that scrolls on its own. From md up it is one page-filled panel with the page radius and a border, spacing-sm from the canvas edges, padded spacing-2xl (32px). Below md the Sidebar is a Sheet, so it runs full bleed with spacing-lg padding plus the bottom safe area. An inset Sidebar takes the sunken fill and a transparent edge.

    Accessibility

    Role: complementary

    KeysAction
    TabMoves from item to item; items are links or buttons in the page order.
    Enter, SpaceA button item activates; a link item follows its href.
    EscapeCloses the Sheet the sidebar becomes on a small screen.
    • The root is an aside (complementary). SidebarContent inside it is the one navigation landmark, named by its label (default "Main").
    • Each SidebarSection is a group named by its visible label (aria-labelledby), or by aria-label on the icon rail where the label is hidden. Its items are a list.
    • The current page's item sets aria-current="page" and its icon switches to the fill weight; the state never relies on color alone.
    • On the rail an item with an icon moves its label into a Tooltip and an sr-only span. Items without icons keep visible text. A disabled item stays out of the tab order, and its Tooltip still opens on hover. Mobile sheets always show full labels.
    • The Sheet names itself with an sr-only title; the trigger button carries the same name in aria-label.
    • Without a SidebarBrand the Sheet puts its Close sidebar button in a row of its own above the content, so the first item never sits under it.
    • Sidebar parts must sit inside a SidebarProvider; without it they throw.
    • SidebarBrand names the internal trigger by its action: Collapse sidebar, Expand sidebar or Close sidebar. The panel mobile rail opens the Sheet; the Sheet header closes it and returns focus to the original opener.
    • SidebarGroup exposes aria-expanded and aria-controls. Closed groups and groups on the rail remove their nested destinations from keyboard navigation. Group open state survives sidebar collapse.
    • With a brand header, offcanvas hides navigation while keeping the internal recovery button on the rail, with the logo hidden. Without a brand header, the existing offcanvas behavior hides the whole column and needs an external opener.
    • On the collapsed rail SidebarBrand removes the decorative logo and keeps the toggle in its place. The toggle stays mounted so keyboard focus survives collapse and expansion.
    • Button destinations with value share one selection through SidebarProvider; controlled selection changes only when the supplied value changes. Disabled items cannot request selection. Selection persists between the desktop rail and mobile Sheet.
    • Collapsed panel group flyouts open on hover without moving focus. Click or keyboard activation moves focus into the flyout; Escape dismisses it. Selecting a destination closes it and preserves the collapsed rail. Default rail groups and mobile groups keep their existing expansion behavior.

    Install

    npx werewolf-ui add sidebar

    Run npx werewolf-ui init once in your app before adding components. Init sets up tokens, their CSS import and agent rules. Add installs this component and its dependencies while preserving your theme. See Installation for requirements and the alternative registry setup.