Skip to main content
BlocksSidebarWorkspace sidebar with command search and collapsible groups

shadcn/ui Sidebar blockWorkspace sidebar with command search and collapsible groups

A shadcn/ui application sidebar built with Sidebar, SidebarMenu and SidebarGroup, featuring a ⌘K command palette powered by CommandDialog, a flat primary navigation and collapsible Favorites, Teams and Topics sections using Collapsible. The footer combines Avatar, DropdownMenu and Tooltip for account actions and a quick-create menu. Ideal for operations tools and workspace apps that need searchable, grouped navigation.

Free@shadcnpro/sidebar-01

Preview

Installation

npx shadcn@latest add @shadcnpro/sidebar-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Workspace sidebar with command search and collapsible groups from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Workspace sidebar with command search and collapsible groups uses Avatar, Button, Collapsible, Command, Dropdown Menu, Sidebar and Tooltip.

npx shadcn@latest add avatar button collapsible command dropdown-menu sidebar tooltip

Install the npm packages

npm install lucide-react

Copy the code

Paste it into components/sidebar-01/index.tsx.

'use client';

import * as React from 'react';
import {
  BellRingIcon,
  CalendarIcon,
  CalendarRangeIcon,
  CircleCheckIcon,
  LayoutDashboardIcon,
  ListChecksIcon,
  MegaphoneIcon,
  NewspaperIcon,
  NotebookIcon,
  PackageIcon,
  WrenchIcon,
} from 'lucide-react';
import { Sidebar, SidebarContent } from '@/components/ui/sidebar';
import { NavCollapsible } from '@/components/sidebar-01/nav-collapsible';
import { NavFooter } from '@/components/sidebar-01/nav-footer';
import { NavHeader } from '@/components/sidebar-01/nav-header';
import { NavMain } from '@/components/sidebar-01/nav-main';
import type { SidebarData } from '@/components/sidebar-01/types';

const data: SidebarData = {
  user: {
    name: 'Lena Okafor',
    email: 'lena@routewise.io',
    avatar: 'https://avatar.vercel.sh/lena-okafor',
  },
  navMain: [
    {
      id: 'overview',
      title: 'Overview',
      url: '#',
      icon: LayoutDashboardIcon,
      isActive: true,
    },
    {
      id: 'shipments',
      title: 'Shipments',
      url: '#',
      icon: ListChecksIcon,
    },
    {
      id: 'dispatch',
      title: 'Dispatch board',
      url: '#',
      icon: CalendarRangeIcon,
    },
    {
      id: 'notes',
      title: 'Notes',
      url: '#',
      icon: NotebookIcon,
    },
    {
      id: 'calendar',
      title: 'Calendar',
      url: '#',
      icon: CalendarIcon,
    },
    {
      id: 'delivered',
      title: 'Delivered',
      url: '#',
      icon: CircleCheckIcon,
    },
    {
      id: 'notifications',
      title: 'Notifications',
      url: '#',
      icon: BellRingIcon,
    },
  ],
  navCollapsible: {
    favorites: [
      {
        id: 'warehouse-ops',
        title: 'Warehouse ops',
        href: '#',
        color: 'bg-chart-1',
      },
      {
        id: 'cold-chain',
        title: 'Cold chain',
        href: '#',
        color: 'bg-chart-2',
      },
      {
        id: 'returns',
        title: 'Returns desk',
        href: '#',
        color: 'bg-chart-3',
      },
      {
        id: 'customs',
        title: 'Customs filings',
        href: '#',
        color: 'bg-chart-4',
      },
    ],
    teams: [
      {
        id: 'fleet-maintenance',
        title: 'Fleet maintenance',
        icon: WrenchIcon,
      },
      {
        id: 'carrier-relations',
        title: 'Carrier relations',
        icon: MegaphoneIcon,
      },
    ],
    topics: [
      {
        id: 'release-notes',
        title: 'Release notes',
        icon: PackageIcon,
      },
      {
        id: 'network-updates',
        title: 'Network updates',
        icon: NewspaperIcon,
      },
    ],
  },
};

export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
  return (
    <Sidebar {...props}>
      <NavHeader data={data} />
      <SidebarContent>
        <NavMain items={data.navMain} />
        <NavCollapsible
          favorites={data.navCollapsible.favorites}
          teams={data.navCollapsible.teams}
          topics={data.navCollapsible.topics}
        />
      </SidebarContent>
      <NavFooter user={data.user} />
    </Sidebar>
  );
}

Use it

Multi-file block: 7 files are installed under components/sidebar-01/.

Usage
import Sidebar01 from '@/components/sidebar-01';
<Sidebar01 />

Overview

Workspace sidebar with command search and collapsible groups is a free sidebar block for shadcn/ui. It is built from the Avatar, Button, Collapsible, Command, Dropdown Menu, Sidebar and Tooltip components with lucide-react, and installs as 7 files you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Category
Sidebar
Component library
Radix UI (radix-ui)
Also available for
Base UI, React Aria
npm packages
lucide-react
Files
7 files in components/sidebar-01/
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and Radix UI details for Workspace sidebar with command search and collapsible groups.