---
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/"
---

# List group

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, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `ListGroup`.

## Try it

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.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-list-group.json --yes
```

```text
Add the Goop List group to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
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); `section` is 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

### Parts

- `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.

```tsx
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.

```tsx
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

```tsx
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 `ListGroupAction` and the `C` key.
- 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 calls `onAdd`.
- 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
- 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.

## Related

- [Item](/themes/trail/components/item): One row of a list of records.
- [Empty](/themes/trail/components/empty): An empty state, what a view or a section shows when it holds nothing yet, with a line of help and an action to add the first item.
- [Skeleton](/themes/trail/components/skeleton): A placeholder in the shape of the content while it loads, for rows, cards and text.
- [Spinner](/themes/trail/components/spinner): A sign that work is under way and its end is unknown, inside a button or a loading view.
