npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-list-group.json --yesList group
ProA group of a list's rows under a header bar with its name and count that folds open and closed, such as issues by status, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ListGroupHeaderThe bar over a group's rows
- ListGroupTitleThe group's name as a heading, first in ListGroupHeader, on one line cut with an ellipsis
- ListGroupCountThe number of rows in the group, after ListGroupTitle
- ListGroupActionThe bar's trailing action
- ListGroupContentThe group's rows, under its bar
import { ListGroup, ListGroupHeader, ListGroupTitle, ListGroupCount, ListGroupAction, ListGroupContent } from '@/components/ui/goop/list-group';
import { Item, ItemContent, ItemTitle } from '@/components/ui/goop/item';
<ListGroup>
<ListGroupHeader variant="section">
<ListGroupTitle>This week</ListGroupTitle>
<ListGroupCount>2</ListGroupCount>
</ListGroupHeader>
<ListGroupContent>
<Item>
<ItemContent>
<ItemTitle>Plan the launch</ItemTitle>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Write the release notes</ItemTitle>
</ItemContent>
</Item>
</ListGroupContent>
</ListGroup>In the default look, fold and unfold each group by its header (click, Enter or Space); tick a task and it moves into Done, the counts following. Done starts folded: open it and untick one to send it back. The plus on Today or This week (or C while the focus is in the group) adds a task there, said under the groups. Look draws every other look the theme’s docs stage shows: on Trail the issue groups, the members bar (variant compact) and the settings bar (variant section), the issue groups folding by their caret; on Meadow the bar alone and folded, over its rows, compact, section and tinted, the to-do column, the narrow column, the list’s title, the busy count and the page edge. The tasks are our own sample, held in the page; an added task is a numbered placeholder.
When to use
- A group of a list's rows under a header bar with its name and count that folds open and closed, such as issues by status.
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 List 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>/trail-list-group.json --yesAdd the Goop List group to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ListGroup, ListGroupHeader, ListGroupTitle, ListGroupCount, ListGroupAction, ListGroupContent } from '@/components/ui/goop/list-group';
import { Item, ItemContent, ItemTitle } from '@/components/ui/goop/item';
<ListGroup>
<ListGroupHeader variant="section">
<ListGroupTitle>This week</ListGroupTitle>
<ListGroupCount>2</ListGroupCount>
</ListGroupHeader>
<ListGroupContent>
<Item>
<ItemContent>
<ItemTitle>Plan the launch</ItemTitle>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Write the release notes</ItemTitle>
</ItemContent>
</Item>
</ListGroupContent>
</ListGroup>- Fits: list, inbox: collection.
- ListGroupHeader: When to use it: a grey bar between groups of ONE list's rows, where the list is split by a key (a status, a role, a time of day) — two groups or more. Records grouped by a key take
compact(a label and its count) or the default (a status with its mark);sectionis a settings list's heading, a title and an action. Never use the bar as a page's or a card's title, nor over a single group whose heading already says what the rows are: there the heading is the page's (PageHeader) or the card's (CardHeader) and the rows follow it with no bar. A heading over a whole block inside a page (a table, a list, a group of cards), with its count, description and buttons, is SectionHeader, not this bar. - height, width, padding, gap, corner, border, background, text: add no class for these.
API reference
- Each option with its sentence: list-group--options.md
- State: open (open / defaultOpen / onOpenChange); drawn by data-state=closed
| Part | What it is |
|---|---|
| ListGroupHeader | The bar over a group's rows; it holds a ListGroupTitle, a ListGroupCount and an optional action; its props: list-group--header.md |
| ListGroupTitle | The group's name as a heading, first in ListGroupHeader, on one line cut with an ellipsis; takes asChild |
| ListGroupCount | The number of rows in the group, after ListGroupTitle; pass the number as its children; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading' |
| ListGroupAction | The bar's trailing action; its props: list-group--action.md |
| ListGroupContent | The group's rows, under its bar |
- Class recipes (cva): listGroupHeaderVariants (ListGroupHeader)
- data-slot values (to select a part by): list-group, list-group-actions, list-group-content, list-group-end, list-group-header, list-group-icon, list-group-inset, list-group-text, list-group-title, list-group-trigger
ListGroupAction
The bar's trailing action.
import { ListGroupAction } from '@/components/ui/goop/list-group';Options
- icon: IconName — The glyph, by the pack's name: the bar's plus 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'
ListGroupHeader
The bar over a group's rows; it holds a ListGroupTitle, a ListGroupCount and an optional action.
import { ListGroupHeader } from '@/components/ui/goop/list-group';Options
- variant: default (default), compact, section
- mark?: ReactNode — The status's mark, in its 16 px box after the caret (the default bar).
- action?: ReactNode — The trailing controls, at the bar's end.
- tint?: ListGroupTint — The bar's status tint: its count, action glyph, caret and wash.
- Types: ListGroupTint = Record<'ink' | 'caret' | 'wash', readonly [light: string, dark: string]>
ListGroup: every option
import { ListGroup } from '@/components/ui/goop/list-group';Options
- gutter?: 'page' —
page: on a list page, the bars and rows start on the page's title edge (the 24 px gutter); give it to every group of the page. - onAdd?: () => void — Opens the group's create row: called by the bar's
ListGroupActionand theCkey. - createRow?: ReactNode — The group's
CreateRow, first in its rows. - createShortcut?: boolean = false —
C(outside a text field) while the focus is in the group callsonAdd. - collapsible?: true | false — Fold the rows from a caret at the bar's start. Or: A group that does not fold: no caret, its rows always shown.
- caretLabel?: string — The caret's name, in the caller's words (a glyph-only control).
- defaultOpen?: boolean = true — Whether the rows show at first, left to the group (open unless
false). - open?: boolean — Whether the rows show, held by the caller with
onOpenChange. - onOpenChange?: (open: boolean) => void — Called with the rows' new state when the caret folds or unfolds them.
- State: open (open / defaultOpen / onOpenChange); drawn by data-state=closed
Accessibility
- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- hover, active, focus-visible, focus-within: the browser's own (:hover, :active, :focus-visible, :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 |
|---|---|
| expanded | the attribute data-state=closed |
| open | the attribute data-state=closed |
| disabled | the prop disabled |
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.