---
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 to-dos by project, 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 to-dos by project.

## 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>/meadow-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 { Badge } from '@/components/ui/goop/badge';
import { Checkbox } from '@/components/ui/goop/checkbox';
import { Item, ItemContent, ItemControl, ItemEnd, ItemOverlay, ItemTitle } from '@/components/ui/goop/item';
import {
  ListGroup,
  ListGroupAction,
  ListGroupContent,
  ListGroupCount,
  ListGroupHeader,
  ListGroupTitle,
} from '@/components/ui/goop/list-group';

const TODOS = [
  { title: 'Book the ferry for the crew', due: 'Dec 4' },
  { title: 'Send the permit to the office', due: 'Dec 1' },
];

function TodoRow({ title, due }: { title: string; due: string }) {
  return (
    <Item variant="todo">
      <ItemOverlay aria-label={title} onClick={() => {}} />
      <ItemControl reveal={false}>
        <Checkbox aria-label={title} />
      </ItemControl>
      <ItemContent>
        <ItemTitle>{title}</ItemTitle>
      </ItemContent>
      <ItemEnd>
        <Badge variant="flag">{due}</Badge>
      </ItemEnd>
    </Item>
  );
}

function TodayGroup({ onAdd }: { onAdd: () => void }) {
  return (
    <ListGroup collapsible caretLabel="Fold Today" onAdd={onAdd} createShortcut>
      <ListGroupHeader sticky action={<ListGroupAction icon="plus" aria-label="Add a to-do" />}>
        <ListGroupTitle>Today</ListGroupTitle>
        <ListGroupCount tabIndex={-1}>{TODOS.length}</ListGroupCount>
      </ListGroupHeader>
      <ListGroupContent>
        {TODOS.map((todo) => (
          <TodoRow key={todo.title} {...todo} />
        ))}
      </ListGroupContent>
    </ListGroup>
  );
}
```

- Fits: list, overview (their recipes); list, inbox: collection.
- ListGroupHeader: When to use it: a bar between groups of ONE list's rows, where the list is split by a key (a project, a status, a day) — two groups or more. 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 and the rows follow it with no bar. The one exception is `variant="title"`: in a column that shows one list at a time, it names that list over its rows, once, with the group's own bars under it.
- height, width, padding, gap, corner, background, text, motion: 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; its props: list-group--count.md
- `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-button, list-group-content, list-group-count-spinner, list-group-end, list-group-frame, list-group-header, list-group-icon, list-group-indicator, 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'

### ListGroupCount

The number of rows in the group, after ListGroupTitle; pass the number as its children.

```tsx
import { ListGroupCount } from '@/components/ui/goop/list-group';
```

### Options

- loading?: boolean = false — The count is being worked out: the spinner over it, and no press reaches `onClick`; it keeps the focus.
- loadingLabel?: string = 'Loading' — What a reader hears beside the count while `loading` (default "Loading").
- Also takes: asChild?: boolean; type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean

### 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, title
- mark?: ReactNode — The status's mark, in its 16 px box before the title.
- action?: ReactNode — The trailing controls, after the count.
- sticky?: boolean = false — Hold the heading at the top of the list's scroll box while the group's rows run under it, on the page's colour.
- tint?: ListGroupTint — The bar's status tint (`ListGroupTint`): its count, action glyph, open 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 rows start on the page's title edge (the 40 px gutter), the caret hung in the gutter before them; give it to every group of the page.
- onAdd?: () => void — Opens the group's create row: called by the bar's `ListGroupAction` (with no `onClick` of its own) and the `C` key.
- createRow?: ReactNode — The group's create row, drawn first in its rows (it draws nothing while closed).
- createShortcut?: boolean = false — `C` (no modifier, outside a text field) while the focus is in the group calls `onAdd`.
- collapsible?: true | false — Fold the rows from the bar's caret, in every look of the bar. 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

## Keyboard

- Enter: activate
- Space: activate

## Accessibility

- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
- hover, active, focus, focus-visible, focus-within: the browser's own (:hover, :active, :focus, :focus-visible, :focus-within): write nothing
- expanded: the attribute data-state=closed
- open: the attribute data-state=closed

## Motion

- The part sets its own motion: add no transition or animation of your own.

## 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

- [Badge](/themes/meadow/components/badge): A small label with a word, an icon or a count, for a status, a tag, a date or a count beside a title or in a row.
- [Checkbox](/themes/meadow/components/checkbox): A round box a person ticks to mark one thing done or chosen.
- [Item](/themes/meadow/components/item): One row of a list of records.
- [Empty](/themes/meadow/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.
