Skip to content
Browse library
BIU UI/Components/Sidebar
COMPONENTS

Sidebar

Explore the Sidebar component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/sidebar

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

EXAMPLE / TSX
"use client";
import { useState } from "react";
import { Sidebar } from "@/components/ui/biu/sidebar";

export function Example() {
  const [active, setActive] = useState("customers");
  return (
    <Sidebar
      activeId={active}
      onSelect={setActive}
      groups={[
        {
          id: "main",
          label: "Workspace",
          items: [
            { id: "overview", label: "Overview" },
            { id: "customers", label: "Customers", badge: 12 },
          ],
        },
      ]}
    />
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

SidebarItemStatus

Also accepts properties from 'online' & 'busy' & 'away' & 'offline'.

Some properties depend on the variant; consult the source for the full union.

SidebarSubItem

SidebarItem

SidebarGroup

SidebarSearchConfig

SidebarRailItem

SidebarRailConfig

SidebarWorkspaceOption

SidebarWorkspaceConfig

SidebarAccountConfig

SidebarPromoItem

SidebarVariant

Also accepts properties from 'flat' & 'inset' & 'floating'.

Some properties depend on the variant; consult the source for the full union.

SidebarCollapseMode

Also accepts properties from 'rail' & 'hide'.

Some properties depend on the variant; consult the source for the full union.

SidebarProps

Source

Review a formatted version of the component source used by the Registry.