---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Seven sidebar shapes

Team, one person, admin, rail, two levels, saved views, recent items

Seven sidebars the parts make, each a `Sidebar` with a `SidebarHeaderRow` in its `SidebarHeader`, then `SidebarContent` and often a `SidebarFooter`. They differ in what they are built from, not only in their words: pick by who uses the app and what a person comes back to (in an app built on the screen recipes, the frame draws the plainer shapes from its props: `docs/screen-frame.md`, "Which sidebar"; draw the others in its place from the parts below).

## Which one

| Shape | Its structure | Pick it when | | --- | --- | --- | | A team's workspace | switcher at the top, search bar with a create button, your pages with counts, each team a folding section with its mark and nested rows, an invite row over the account | several people share the app in teams or projects, each with the same few pages of its own | | A tool for one person | the app's name with a new-item button, a search field that narrows the sidebar in place, pinned items folding over the main lists, Settings and Help at the foot | one person, one place: no workspaces to switch, nobody to invite, a handful of lists and the items they keep close | | An admin console | the way back to the app, a search field that finds a setting, areas that fold from their labels with counts and an add button on one label | many settings or places grouped in a few areas, where a person looks one up by name | | A compact rail | the sidebar opened as its 44 px rail: the workspace tile, the toggle, icon rows with tooltips, a folded section as one button with a menu of its rows, the account avatar | the page needs the width (a dashboard, a board, an editor) and the places are few enough to know by their icons | | Two levels | an icon rail of the product's areas beside a column of the current area's views and a folding section, the account at the column's foot | the product has several large areas (studies, inbox, calendar, reports), each with its own views and folders | | Saved views | the app's name with search and create buttons, the record pages with counts, the person's saved filters folding with counts and a plus that saves one, the team's views folded, a plan card with a usage meter over the account | a records app (clients, contacts, deals) where each person keeps their own filtered lists and the plan has a limit worth showing | | Recent items | the app's name with a search button, one wide new-item button, two fixed pages, then the recent items under the day they were last used, each removed by its cross | what a person comes back to is a long, growing list of their own items (chats, documents, drafts) rather than a few fixed pages |

## The parts of each

- **A team's workspace**: `WorkspaceSwitcher` alone in the header row; under it a search `Button` that opens the `CommandPalette` (`CommandPaletteTrigger asChild`, Cmd/Ctrl K) with an outline `IconButton` as `CreateDialog`'s `trigger` at its end; your pages in a `SidebarGroup` with no label (`SidebarMenu`, `SidebarMenuItem`, `SidebarMenuButton`, a count in `SidebarMenuBadge`); then one `SidebarGroup collapsible variant="item"` per team, its `SidebarGroupLabel` with the team's `mark` (a solid 14 px `Avatar size="3xs"` with the team's initial) and a `CollapsibleAction` plus that makes a task in that team, its rows nested under the name (`defaultOpen={false}` on all but the first); in `SidebarFooter` an "Invite people" `SidebarMenuButton` that opens the `InviteDialog`, then the person's `AccountMenu`.
- **A tool for one person**: the app's name in `SidebarTitle` with a ghost `IconButton` after it as `CreateDialog`'s `trigger`; a `SearchInput size="sm"` under the row that narrows the sidebar's rows and the page as a person types ("/" focuses it, Escape clears it); a `SidebarGroup collapsible` labelled Pinned whose rows each carry a `SidebarMenuAction icon="x"` that unpins it, over one unlabelled `SidebarGroup` of the lists; Settings and Help as `SidebarMenuButton` rows in a `SidebarMenu` in `SidebarFooter`.
- **An admin console**: a `Link` back to the app in the header row and a `SearchInput size="sm"` under it; one `SidebarGroup collapsible` per area (`defaultOpen={false}` on one seldom used; held `open` while the search narrows, so every area with a match shows it), a `SidebarMenuBadge` count on a row that waits on someone, and an add button on a label (`SidebarGroupLabel action={<SidebarGroupAction icon="plus" aria-label="…" />}`).
- **A compact rail**: `Sidebar defaultOpen={false}`, the `WorkspaceSwitcher` then `SidebarRailToggle` in the header row, every `SidebarMenuButton` with its `icon` (the rail shows the icon alone and its words in a tooltip), a section that starts folded (`SidebarGroup collapsible defaultOpen={false}`) standing as one button whose menu lists its rows (give its label a `mark`, a star for starred items, so the button never wears the folder a destination row does), the `AccountMenu` in `SidebarFooter`; the toggle or Cmd/Ctrl B widens it.
- **Two levels**: two `Sidebar`s side by side in the frame's rail. The first is held as its rail (`open={false}`, `shortcut={false}`, no toggle): the `WorkspaceSwitcher` in its header row, the areas as `SidebarMenuButton` rows with their icons, Settings in its `SidebarFooter`. The second is the area's column: its name in `SidebarTitle` with a ghost `IconButton` as `CreateDialog`'s `trigger`, its views with `SidebarMenuBadge` counts, one `SidebarGroup collapsible` (folders, calendars), the `AccountMenu` in its `SidebarFooter`. Give each its own `aria-label`, and the first the frame's hairline down its end (`after:border-e-half after:border-accent-strong`, drawn over it) where the two share one fill; picking an area swaps the second. Below the frame's wide window both stand in its navigation sheet, one over the other.
- **Saved views**: the app's name in `SidebarTitle`, then two ghost `IconButton`s, one the `CommandPalette`'s trigger (`tooltipKeys={['⌘', 'K']}`), one `CreateDialog`'s; the record pages with counts; a `SidebarGroup collapsible` of the person's views with a `SidebarGroupAction` plus that saves the current filter under a name (a `CreateDialog`), and one more, folded, of the team's; in `SidebarFooter` a `Card variant="outline"` holding a `Meter` (with `MeterLabel`, `MeterValue` and a `threshold`) and a small outline `Button`, over the `AccountMenu`.
- **Recent items**: the app's name in `SidebarTitle` with a ghost `IconButton` that opens the `CommandPalette`; one wide outline `Button` for a new item under the row; a `SidebarGroup` of two fixed pages; then one static `SidebarGroup` per day (`SidebarGroupLabel` "Today", "Previous 7 days", "Older"), each row a `SidebarMenuButton` with the item's `icon` (so the day's label stands on the glyphs' edge) and a `SidebarMenuAction icon="x"` that removes it (a day with none left is not drawn); the `AccountMenu` in `SidebarFooter`.

## The slots a start turns on

`node goop/agent/start.mjs --app <type>` writes the file below with the slots its type's row names (the head's workspace switcher, the search, the rail, the account at the foot, the recent items under their day, each a link to its own route) and puts `<SidebarShape>` round every screen in `App.tsx`, so each screen's frame draws them (`FrameShape`, `docs/screen-frame.md`). Turn a slot on or off in `SLOTS`; swap the sample workspaces, person and recent items for your store's. A sign-in's own menu (`docs/screen-account.md`) wins over the sample person.

```tsx shape // src/screens/sidebar.tsx: the sidebar's slots on every screen, those your app type's row names import { type ReactNode, useState } from 'react'; import { AccountMenu, AccountMenuColorMode, AccountMenuContent, AccountMenuHeader, AccountMenuTrigger, } from '@/components/ui/goop/account-menu'; import { DropdownMenuItem } from '@/components/ui/goop/dropdown-menu'; import { SAMPLE_BRAND } from '@/lib/goop/trail/sample-brand'; import { FrameAccount, type FrameSection, FrameShape, hasPage } from './frame'; import { hrefOf } from './router';

// ---- the slots your app's sidebar draws: the head's workspace switcher, the search, the rail, the account, the recent const SLOTS = { switcher: false, search: false, rail: false, account: false, recent: false };

// ---- sample workspaces and person: swap them for your store's const WORKSPACES = [{ id: SAMPLE_BRAND.address, name: SAMPLE_BRAND.name }]; const PERSON = { name: 'Teodora Valk', email: 'teodora.valk@fieldwork.test' };

// ---- sample recent items under the day they were last used: swap them for your store's, newest first const RECENT: readonly FrameSection[] = [ { label: 'Today', rows: [{ words: 'Consent step in the interviews', path: '/chat/consent', icon: 'message' }] }, { label: 'Previous 7 days', rows: [{ words: 'Reminders for Thursday’s visits', path: '/chat/reminders', icon: 'message' }], }, { label: 'Older', rows: [{ words: 'Eastgate Library visitor survey', path: '/chat/library', icon: 'message' }] }, ];

/** The person's menu at the sidebar's foot, until a sign-in gives its own (`FrameAccount`). */ function SampleAccount() { return ( <AccountMenu> <AccountMenuTrigger name={PERSON.name} email={PERSON.email} /> <AccountMenuContent> <AccountMenuHeader /> {hasPage('/settings') ? ( <DropdownMenuItem icon="settings" asChild> <a href={hrefOf('/settings')}>Settings</a> </DropdownMenuItem> ) : null} <AccountMenuColorMode /> </AccountMenuContent> </AccountMenu> ); }

/** Round every screen in App.tsx: each screen's frame draws the slots on; a screen's own props win. */ export function SidebarShape({ children }: { children: ReactNode }) { const [workspace, setWorkspace] = useState<string>(SAMPLE_BRAND.address); const switcher = { workspaces: WORKSPACES, value: workspace, onValueChange: setWorkspace }; const shape = { search: SLOTS.search, collapsible: SLOTS.rail ? ('rail' as const) : false, ...(SLOTS.switcher ? { switcher } : {}), ...(SLOTS.recent ? { sections: RECENT } : {}), }; const shaped = <FrameShape value={shape}>{children}</FrameShape>; return SLOTS.account ? <FrameAccount account={<SampleAccount />}>{shaped}</FrameAccount> : shaped; }

```

```tsx app
// src/App.tsx: the shape's two lines in the app recipe's App.tsx (start.mjs adds them with --app)
import { SidebarShape } from './screens/sidebar';
      <SidebarShape>{screenFor(route)}</SidebarShape>
```
