npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sidebar-group.json --yesSidebar group
ProA titled group of links in the sidebar, such as the notes of a day or your projects, that can fold open and closed, for React and Tailwind CSS. Part of Goop Pro.
Sidebar group
What an agent sees
- SidebarGroupLabelThe group's name over its rows
- SidebarGroupContentHolds the group's rows, a SidebarMenu, under the label
- SidebarGroupActionA folding section's trailing action, in its label
- SidebarMenuThe list of rows
- SidebarMenuItemOne row of a SidebarMenu
- SidebarMenuActionA row's trailing control, after its
SidebarMenuButtonin the sameSidebarMenuItem(alone), or one of several in the row'sSidebarMenuActions - SidebarMenuActionsA row's two or more trailing controls (add and more), after its
SidebarMenuButtonin the sameSidebarMenuItem - SidebarMenuToggleA collection's mark at the start of its row, before its
SidebarMenuButton, which opens and shuts what the collection holds
import {
SidebarGroup,
SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
SidebarMenu,
SidebarMenuAction,
SidebarMenuActions,
SidebarMenuItem,
SidebarMenuToggle,
} from '@/components/ui/goop/sidebar-group';
import { SidebarMenuBadge, SidebarMenuButton } from '@/components/ui/goop/sidebar-menu-button';
const NOTES = ['Survey', 'Drainage permit', 'Soil samples'];
function TodayNotes({ onNewNote }: { onNewNote: () => void }) {
return (
<SidebarGroup collapsible>
<SidebarGroupLabel action={<SidebarGroupAction icon="plus" aria-label="New note" onClick={onNewNote} />}>
Today
</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{NOTES.map((note) => (
<SidebarMenuItem key={note}>
<SidebarMenuButton href={`/notes/${note.toLowerCase().replaceAll(' ', '-')}`} icon="file-text">
{note}
</SidebarMenuButton>
</SidebarMenuItem>
))}
<SidebarMenuItem>
<SidebarMenuToggle aria-label="Show Sites" />
<SidebarMenuButton href="/sites">
Sites
<SidebarMenuBadge>4</SidebarMenuBadge>
</SidebarMenuButton>
<SidebarMenuActions>
<SidebarMenuAction icon="plus" aria-label="Add a site" />
<SidebarMenuAction icon="ellipsis" aria-label="More for Sites" />
</SidebarMenuActions>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
);
}Fold and unfold each group by its label (click, Enter or Space); press + to add a favourite (the group opens to show it); press a row to make it the current page. The pages are our own sample; nothing opens.
Sidebar group dismiss
What an agent sees
- SidebarGroupLabelThe group's name over its rows
- SidebarGroupContentHolds the group's rows, a SidebarMenu, under the label
- SidebarGroupActionA folding section's trailing action, in its label
- SidebarMenuThe list of rows
- SidebarMenuItemOne row of a SidebarMenu
- SidebarMenuActionA row's trailing control, after its
SidebarMenuButtonin the sameSidebarMenuItem(alone), or one of several in the row'sSidebarMenuActions - SidebarMenuActionsA row's two or more trailing controls (add and more), after its
SidebarMenuButtonin the sameSidebarMenuItem - SidebarMenuToggleA collection's mark at the start of its row, before its
SidebarMenuButton, which opens and shuts what the collection holds
import {
SidebarGroup,
SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
SidebarMenu,
SidebarMenuAction,
SidebarMenuActions,
SidebarMenuItem,
SidebarMenuToggle,
} from '@/components/ui/goop/sidebar-group';
import { SidebarMenuBadge, SidebarMenuButton } from '@/components/ui/goop/sidebar-menu-button';
const NOTES = ['Survey', 'Drainage permit', 'Soil samples'];
function TodayNotes({ onNewNote }: { onNewNote: () => void }) {
return (
<SidebarGroup collapsible>
<SidebarGroupLabel action={<SidebarGroupAction icon="plus" aria-label="New note" onClick={onNewNote} />}>
Today
</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{NOTES.map((note) => (
<SidebarMenuItem key={note}>
<SidebarMenuButton href={`/notes/${note.toLowerCase().replaceAll(' ', '-')}`} icon="file-text">
{note}
</SidebarMenuButton>
</SidebarMenuItem>
))}
<SidebarMenuItem>
<SidebarMenuToggle aria-label="Show Sites" />
<SidebarMenuButton href="/sites">
Sites
<SidebarMenuBadge>4</SidebarMenuBadge>
</SidebarMenuButton>
<SidebarMenuActions>
<SidebarMenuAction icon="plus" aria-label="Add a site" />
<SidebarMenuAction icon="ellipsis" aria-label="More for Sites" />
</SidebarMenuActions>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
);
}Dismiss the starter steps by their crosses (shown under the pointer or the keyboard): the focus moves on to the next row, the group goes with the last one, and a button brings them all back. The steps lead nowhere; dismissing only hides them in the page.
When to use
- A titled group of links in the sidebar, such as the notes of a day or your projects, that can fold open and closed.
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 group 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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-sidebar-group.json --yesAdd the Goop Sidebar group to this project. The install steps are at https://goop.so/docs/install.mdUsage
import {
SidebarGroup,
SidebarGroupAction,
SidebarGroupContent,
SidebarGroupLabel,
SidebarMenu,
SidebarMenuAction,
SidebarMenuActions,
SidebarMenuItem,
SidebarMenuToggle,
} from '@/components/ui/goop/sidebar-group';
import { SidebarMenuBadge, SidebarMenuButton } from '@/components/ui/goop/sidebar-menu-button';
const NOTES = ['Survey', 'Drainage permit', 'Soil samples'];
function TodayNotes({ onNewNote }: { onNewNote: () => void }) {
return (
<SidebarGroup collapsible>
<SidebarGroupLabel action={<SidebarGroupAction icon="plus" aria-label="New note" onClick={onNewNote} />}>
Today
</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{NOTES.map((note) => (
<SidebarMenuItem key={note}>
<SidebarMenuButton href={`/notes/${note.toLowerCase().replaceAll(' ', '-')}`} icon="file-text">
{note}
</SidebarMenuButton>
</SidebarMenuItem>
))}
<SidebarMenuItem>
<SidebarMenuToggle aria-label="Show Sites" />
<SidebarMenuButton href="/sites">
Sites
<SidebarMenuBadge>4</SidebarMenuBadge>
</SidebarMenuButton>
<SidebarMenuActions>
<SidebarMenuAction icon="plus" aria-label="Add a site" />
<SidebarMenuAction icon="ellipsis" aria-label="More for Sites" />
</SidebarMenuActions>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
);
}- Fits: account, chat, settings (their recipes).
- Also known as: SidebarMenu, SidebarMenuItem.
- height, width, padding, gap, corner, background, text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| collapsible? | boolean = false | Fold the section from its label. |
| variant? | 'default' | 'item' = 'default' | A folding group's look: default a section, item a team's section. |
| defaultOpen? | boolean = true | Whether a folding group starts open, when the group holds it; true by default. |
| open? | boolean | Whether a folding group is open, when the caller holds it; with onOpenChange. |
| onOpenChange? | (open: boolean) => void | Called with the new open state when a person folds or unfolds the group from its label. |
- State: open (open / defaultOpen / onOpenChange); drawn by data-focus-visible, data-state=open
| Part | What it is |
|---|---|
| SidebarGroupLabel | The group's name over its rows; in a collapsible group it is the button that folds them; its props: sidebar-group--label.md |
| SidebarGroupContent | Holds the group's rows, a SidebarMenu, under the label; in a collapsible group this is what folds |
| SidebarGroupAction | A folding section's trailing action, in its label; its props: sidebar-group--action.md |
| SidebarMenu | The list of rows |
| SidebarMenuItem | One row of a SidebarMenu; put a SidebarMenuButton in it, then an optional SidebarMenuAction |
| SidebarMenuAction | A row's trailing control, after its SidebarMenuButton in the same SidebarMenuItem (alone), or one of several in the row's SidebarMenuActions; its props: sidebar-group--sidebar-menu-action.md |
| SidebarMenuActions | A row's two or more trailing controls (add and more), after its SidebarMenuButton in the same SidebarMenuItem |
| SidebarMenuToggle | A collection's mark at the start of its row, before its SidebarMenuButton, which opens and shuts what the collection holds; its props: sidebar-group--sidebar-menu-toggle.md |
SidebarGroupAction
A folding section's trailing action, in its label.
import { SidebarGroupAction } from '@/components/ui/goop/sidebar-group';Options
- icon: IconName — The glyph, by the pack's name: a section's add button is
plus. - Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; aria-label: string; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'
SidebarGroupLabel
The group's name over its rows; in a collapsible group it is the button that folds them.
import { SidebarGroupLabel } from '@/components/ui/goop/sidebar-group';Options
- ref?: Ref<HTMLElement> — The label's element: the heading, or in a folding group the trigger.
- mark?: ReactNode — A leading glyph before the words, in a 16 px box (a team's mark): the caller's one element.
- action?: ReactNode — A control at the end of a folding group's label: a
SidebarGroupAction, or aCollapsibleActionin a team's section. - headingLevel?: 2 | 3 | 4 | 5 | 6 = 2 — A static label's heading level: 2 (the default); a folding group's label is its trigger, no heading.
Keyboard
| Key | What it does |
|---|---|
| Enter | Follow |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-within: the browser's own (:hover, :active, :focus-within): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| focus-visible | the attribute data-focus-visible |
| expanded | the attribute data-state=open |
| open | the attribute data-state=open |
| current | the attribute aria-current=page |
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.