Skip to content

Workspace sidebar

App sidebar with collapsible nested teams.

Usage

Usage
import { AppSidebar } from '@/components/blocks/sidebar-01'


<div className="flex h-screen flex-col md:flex-row">
  <AppSidebar />
  <main className="flex-1">…</main>
</div>


// Your own workspace, navigation and teams, with routing in your hands
<AppSidebar
  workspace={{ name: 'Spruce', logo: <SpruceLogo /> }}
  user={{ name: 'Sam Lee', avatar: '/avatars/sam.jpg' }}
  navItems={[
    { id: 'inbox', label: 'Inbox', icon: <InboxIcon />, badge: 4, badgeLabel: '4 unread' },
    { id: 'messages', label: 'Messages', icon: <ChatIcon /> },
  ]}
  teams={{
    label: 'Teams',
    groups: [
      {
        id: 'design',
        name: 'Design',
        color: 'oklch(62.6% 0.205 254.947)',
        children: [{ id: 'brand', name: 'Brand', color: 'oklch(72% 0 0)' }],
      },
    ],
  }}
  upgrade={{ title: 'Trial ends Friday', body: 'Keep your history and seats.', href: '/billing' }}
  activeId={pathname}
  onNavigate={(id) => navigate(id)}
/>

Install

pnpm dlx shadcn@latest add @pastaui-pro/sidebar-01

Source

Props

Workspace sidebar props
PropTypeDefaultDescription
workspaceSidebarWorkspace= KittiwakeWorkspace name, logo and optional switcher menu links ({ label, href }[]) shown at the top.
userSidebarUser= { name: 'Orla Quennell' }Signed-in user. Shows the avatar image when given, otherwise their initials.
navItemsSidebarNavItem[]= Inbox and MessagesMain links, each with an id, label, icon, optional href, badge count and badgeLabel read by screen readers.
teamsSidebarTeams | null= Harbourlane and three teamsSection label and collapsible groups. Each group and child has an id, name, marker colour and optional href. Pass null to hide.
upgradeSidebarUpgrade | null= Seats cardUpgrade card title, body, ctaLabel and href. Pass null to hide.
footerLinksSidebarFooterLink[]= Got feedback? and SupportLinks under the upgrade card, each with an id, label, href and icon.
activeIdstring= —Controlled id of the active nav item or team.
defaultActiveIdstring= 'messages'Active item on first render when uncontrolled.
onNavigate(id: string) => void= —Called when a nav item or team is chosen.
defaultTeamsOpenboolean= trueWhether the team groups start expanded.
labelstring= 'Primary'Accessible name for the navigation landmark and mobile sheet.
classNamestring= —Additional classes for the root.
styleCSSProperties= —Inline styles, handy for overriding the --pp-* theme variables.