Sidebar

3 variants

Production workspace compositions built with beUI's compound animated sidebar, including responsive drawers, live navigation search, compact and off-canvas collapse modes, and accessible focus handling.

Rail sidebar

A persistent icon rail with a collapsible second panel. Hover to reveal navigation over the workspace, or keep it expanded beside your content.

Launch direction

Private page

Launch direction

A place for the early thoughts, useful references, and small decisions that move the work forward.

01

Find the starting point

Bring the notes and references together.

02

Make room for the good ideas

Keep the next step clear and close.

03

Share when it feels ready

A little progress is still progress.

"use client";

import { FileText } from "lucide-react";
import { useState } from "react";
import { SidebarRail } from "@/components/premium/sidebar-blocks/sidebar-rail";

export function SidebarRailPreview() {
  const [title, setTitle] = useState("Launch direction");

  return (
    <SidebarRail
      onItemSelect={(item) => setTitle(item.label)}
      onCreate={() => setTitle("Untitled page")}
      workspaceHeader={<p className="truncate text-sm font-medium">{title}</p>}
    >
      <div className="mx-auto flex h-full max-w-xl flex-col justify-center pb-12">
        <div className="mb-6 flex items-center gap-2 text-xs text-muted-foreground">
          <FileText aria-hidden="true" className="size-4" />
          Private page
        </div>
        <h1 className="text-4xl font-medium tracking-tight">{title}</h1>
        <p className="mt-4 max-w-md text-sm leading-6 text-muted-foreground">
          A place for the early thoughts, useful references, and small decisions
          that move the work forward.
        </p>
        <div className="mt-9 divide-y divide-border rounded-2xl border border-border bg-background px-5">
          {[
            [
              "01",
              "Find the starting point",
              "Bring the notes and references together.",
            ],
            [
              "02",
              "Make room for the good ideas",
              "Keep the next step clear and close.",
            ],
            [
              "03",
              "Share when it feels ready",
              "A little progress is still progress.",
            ],
          ].map(([number, heading, description]) => (
            <div key={number} className="flex gap-4 py-5">
              <span className="pt-0.5 font-mono text-xs text-muted-foreground">
                {number}
              </span>
              <div>
                <p className="text-sm font-medium">{heading}</p>
                <p className="mt-1 text-xs leading-5 text-muted-foreground">
                  {description}
                </p>
              </div>
            </div>
          ))}
        </div>
      </div>
    </SidebarRail>
  );
}

Install

$ bunx --bun shadcn add @beui-pro/sidebar-rail

API Reference

Every prop is optional unless marked required. Data, copy, and colors default to the sample content.

SidebarRail14 props
  • workspaceName

    Workspace name in the panel title and breadcrumbs.

    string
  • sections

    Rail sections and their page groups. Defaults to the sample sections.

    readonly SidebarRailSection[]
  • defaultExpanded

    Starts with the panel pinned open when true.

    boolean

    Default true

  • expanded

    Whether the panel is pinned open, when controlled.

    boolean
  • onExpandedChange

    Called with the new value when the panel is pinned or collapsed.

    ((expanded: boolean) => void)
  • defaultItemId

    Id of the page selected at first; only read on mount.

    string
  • onItemSelect

    Called with the page and its section when the user selects a page.

    ((item: SidebarRailItem, section: SidebarRailSection) => void)
  • onCreate

    Called when the user clicks the New page button.

    (() => void)
  • account

    User shown as initials at the bottom of the rail.

    { name: string; initials: string; }
  • onAccountClick

    Called when the user clicks the account button in the rail.

    (() => void)
  • panelHeader

    Replaces the panel title; search and collapse controls stay built in. Pass null to hide it.

    ReactNode
  • railFooter

    Replaces the account control at the bottom of the icon rail. Pass null to hide it.

    ReactNode
  • workspaceHeader

    Replaces the workspace breadcrumbs; the navigation toggle stays built in. Pass null to hide them.

    ReactNode
  • className

    Classes merged onto the root element.

    string
Types2 types

The object types these props take, field by field.

SidebarRailItem3 fields
  • idRequired

    Unique id used to track the selected page.

    string
  • labelRequired

    Page name shown in the panel and matched by search.

    string
  • icon

    Optional Lucide icon shown before the label.

    LucideIcon
SidebarRailSection4 fields
  • idRequired

    Unique id for the rail section.

    string
  • labelRequired

    Section name shown as the rail tooltip and panel title.

    string
  • iconRequired

    Lucide icon shown on the rail button.

    LucideIcon
  • groupsRequired

    Labeled groups of pages listed in the panel for this section.

    readonly { label: string; items: readonly SidebarRailItem[]; }[]

Workspace sidebar

A sharp operations sidebar composed from beUI's provider, panel, group, menu, submenu, and inset primitives, with searchable navigation, live badges, mobile focus trapping, and a dashboard workspace.

Overview

Live workspace

Good morning, Maya.

Your workspace stays in place while the navigation folds into a focused icon rail.

Runs

1,284

Success rate

98.4%

Time saved

42h

"use client";

import { SidebarWorkspace } from "@/components/premium/sidebar-blocks";

export function SidebarWorkspacePreview() {
  return <SidebarWorkspace />;
}

Install

$ bunx --bun shadcn add @beui-pro/sidebar-workspace

API Reference

Every prop is optional unless marked required. Data, copy, and colors default to the sample content.

SidebarWorkspace5 props
  • workspaceName

    Workspace selected at first; only read on mount.

    string

    Default Northstar AI

  • workspaces

    Workspaces listed in the switcher, after the initial one.

    readonly string[]

    Default ["Northstar AI", "Acme Studio", "Orbit Labs"]

  • onWorkspaceChange

    Called with the workspace name when the user switches workspace.

    ((workspace: string) => void)
  • account

    Signed-in user shown in the sidebar footer.

    { name: string; email: string; initials: string; }
  • className

    Classes merged onto the root element.

    string

Off-canvas sidebar

A flat workspace sidebar with searchable navigation, an animated workspace switcher, and a full off-canvas collapse that removes labels and icons together.

Inbox

Focus workspace

Everything important, without nested navigation.

Collapse the sidebar to give the active workspace the full canvas. The navigation returns from the same edge when needed.

Open projects

18

Updates today

32

"use client";

import { SidebarOffcanvas } from "@/components/premium/sidebar-blocks";

export function SidebarOffcanvasPreview() {
  return <SidebarOffcanvas />;
}

Install

$ bunx --bun shadcn add @beui-pro/sidebar-offcanvas

API Reference

Every prop is optional unless marked required. Data, copy, and colors default to the sample content.

SidebarOffcanvas9 props
  • workspaceName

    Workspace selected at first; only read on mount.

    string

    Default Northstar AI

  • workspaces

    Workspaces listed in the switcher, after the initial one.

    readonly string[]

    Default ["Northstar AI", "Acme Studio", "Orbit Labs"]

  • onWorkspaceChange

    Called with the workspace name when the user switches workspace.

    ((workspace: string) => void)
  • navigationItems

    Sidebar links, also searchable. Defaults to the sample nav items.

    readonly SidebarOffcanvasNavigationItem[]
  • activeItem

    Label of the active item when controlled.

    string
  • defaultActiveItem

    Label of the item active at first when uncontrolled.

    string

    Default Inbox

  • onNavigate

    Called with the item when the user picks it from the list or search.

    ((item: SidebarOffcanvasNavigationItem) => void)
  • account

    Signed-in user shown in the sidebar footer.

    { name: string; email: string; initials: string; }
  • className

    Classes merged onto the root element.

    string
Types1 type

The object types these props take, field by field.

SidebarOffcanvasNavigationItem4 fields
  • labelRequired

    Item text; also its id for the active item and search.

    string
  • iconRequired

    Lucide icon shown before the label and in search results.

    LucideIcon
  • keywords

    Extra search terms that match this item.

    readonly string[]
  • badge

    Small count or tag shown at the end of the row.

    string