Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sidebar.json --yes

Sidebar

Pro

The app's main navigation down one side of the window, for React and Tailwind CSS. Part of Goop Pro.

Sidebar

Press a row (or Tab to it and press Enter) to switch the page beside it; read the inbox’s notices and its count goes down; switch the workspace from the menu at the top; collapse the sidebar to its rail of icons with the toggle or ⌘B / Ctrl+B and hover a row for its name; on a phone-sized window open it from the top bar’s button. In a theme whose frame is the icon rail (Meadow), the sidebar is that rail beside a panel of the day’s notes: the rail’s icons switch the section, its plus adds a note, and the same toggle and keys collapse it to the rail alone. The pages, the notes, the workspaces and the person are our own sample, and signing out does nothing.

Sidebar settings

Press a row to switch the settings page beside it; type in the field to filter the rows (“mem”, “bill”); “Back to app” leaves settings, and a button brings you back. The pages are our own sample with a line each. The filter is this example’s: the settings sidebar’s field filters nothing by itself.

When to use

  • The app's main navigation down one side of the window.
  • Also called: side navigation or nav drawer.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Sidebar on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sidebar.json --yes
PROMPT
Add the Goop Sidebar to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { SidebarProvider, SidebarScope, useSidebar, SidebarFooter } from '@/components/ui/goop/sidebar';

import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
import { Link } from '@/components/ui/goop/link';
import {
  Sidebar,
  SidebarContent,
  SidebarHeader,
  SidebarHeaderRow,
  SidebarRail,
  SidebarRailToggle,
  SidebarTitle,
} from '@/components/ui/goop/sidebar';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/goop/tooltip';

function AppSidebar() {
  return (
    <Sidebar aria-label="Main" storageKey="sidebar:collapsed">
      <SidebarRail>
        <SidebarRailToggle />
        <hr />
        <Tooltip>
          <TooltipTrigger asChild>
            <IconButton asChild size="lg" aria-label="Notes">
              <a href="/notes" aria-current="page">
                <IconButtonIcon icon="file-text" />
              </a>
            </IconButton>
          </TooltipTrigger>
          <TooltipContent side="right">Notes</TooltipContent>
        </Tooltip>
      </SidebarRail>
      <SidebarHeader>
        <SidebarHeaderRow>
          <SidebarTitle>Notes</SidebarTitle>
          <SidebarRailToggle />
        </SidebarHeaderRow>
      </SidebarHeader>
      <SidebarContent>
        <Link href="/notes/north-field" className="w-full">
          Survey
        </Link>
        <Link href="/notes/permits" className="w-full">
          Drainage permit
        </Link>
      </SidebarContent>
    </Sidebar>
  );
}
  • Fits: account, chat, inbox, settings (their recipes).
  • height, width, padding, gap, corner, border, background, text: add no class for these.

API reference

Options
OptionTypeWhat it does
variantdefault | settings = default
open?booleanDrawn as the open column (true) or the rail (false), when the caller holds it (with onOpenChange).
defaultOpen?boolean = trueWhether it starts as the open column (true, the default) or the rail (false), when the sidebar holds it.
onOpenChange?(open: boolean) => voidCalled as it opens (true) or collapses to the rail (false): by its SidebarRailToggle, its key, or useSidebar().setCollapsed.
shortcut?string | false = 'mod+b'The key that switches it, mod+b by default (mod is ⌘ on an Apple keyboard, Ctrl elsewhere; shift and alt may join it); false for none.
storageKey?stringRemembers the rail across a reload under this key in the page's local storage ("sidebar:collapsed"; give each sidebar its own).
container?HTMLElement | nullWhere a caller's rail tooltips are drawn (useSidebar().container); the end of <body> when left out.
  • State: open (open / defaultOpen / onOpenChange)
Parts
PartWhat it is
SidebarProviderHolds the sidebar's rail state for what is outside the nav
SidebarScopeWhere the sidebar's parts stand outside the sidebar, beside it (a settings page's section navigation of SidebarGroup rows)
SidebarRailThe sidebar's rail, the column of the app's sections that stays beside its panel and is all that shows collapsed (<Sidebar><SidebarRail>…</SidebarRail><SidebarHeader>…</SidebarHeader><SidebarContent>…</SidebarContent></Sidebar>)
SidebarHeaderThe region at the top, which never scrolls
SidebarHeaderRowThe header's row of controls
SidebarTitleThe column's name in the header row (<SidebarTitle>Notes</SidebarTitle> before the SidebarRailToggle)
SidebarContentThe column of groups, which scrolls under the header; its end is its own
SidebarFooterThe region at the foot, which never scrolls
SidebarRailToggleits props: sidebar--rail-toggle.md
useSidebarThe sidebar's rail state, for a part of the caller's own inside it (const { open } = useSidebar())
  • Class recipes (cva): sidebarVariants (Sidebar)

SidebarRailToggle

TSX
import { SidebarRailToggle } from '@/components/ui/goop/sidebar';

Options

  • aria-label?: string — One spoken name in both states, instead of the two below.
  • collapseLabel?: string = 'Collapse sidebar' — Its spoken name while the sidebar is open.
  • expandLabel?: string = 'Expand sidebar' — Its spoken name while the sidebar is the rail.
  • children?: ReactElement — With asChild, that one control.
  • Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'

Keyboard

KeyWhat it does
EnterActivate

Accessibility

  • The part itself answers the keys above.
  • hover, active: the browser's own (:hover, :active): write nothing

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

Follows shadcn/ui's file names and conventions.

goop.so/themes/meadow/components/sidebar.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sidebar.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.