Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-table.json --yes

Table

Pro

A table of records compared across columns, for React and Tailwind CSS. Part of Goop Pro.

Pick a look. Sortable: sort by any column with its sort control (press again to turn it), show only unpaid invoices, remove a row and Undo it back into its place. Grouped: the invoices under a band per status, each counting its rows; a click on a band or Enter on its caret folds it, said beside the filter. Display: the Display menu picks the columns, the grouping, the sort and the density, staying open between picks. Foot: sixteen invoices in a table of fixed height, its rows scrolling under the pinned totals and pager. Narrow the stage under 641 px and the status and due columns leave, each invoice name opening its whole record. The sort, the filter, the grouping and the pages are the example’s own: the table draws whatever rows it is handed, in that order.

When to use

  • A table of records compared across columns.
  • Also called: data table or data grid.

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

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-table.json --yes
PROMPT
Add the Goop Table to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { TableCaption, TableFooter, TableFooterBar, TableGroup } from '@/components/ui/goop/table';

import { Avatar } from '@/components/ui/goop/avatar';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/ui/goop/table';
import { TableCell } from '@/components/ui/goop/table-cell';

const CREW = [
  { id: 'teodora', name: 'Teodora Valk', email: 'teodora@fieldwork.test', role: 'Admin' },
  { id: 'bilal', name: 'Bilal Rashed', email: 'bilal@fieldwork.test', role: 'Member' },
];

function Crew({ onMore, onSort }: { onMore: (id: string) => void; onSort: () => void }) {
  return (
    <Table aria-label="Crew" className="max-h-96">
      <TableHeader sticky>
        <TableRow>
          <TableHead className="w-full" sorted="ascending" onSort={onSort}>
            Member
          </TableHead>
          <TableHead>Role</TableHead>
          <TableHead align="end">Actions</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        {CREW.map((person) => (
          <TableRow key={person.id}>
            <TableCell>
              <span className="flex items-center gap-2">
                <Avatar variant="solid" size="sm" hue="neutral" name={person.name}>
                  {person.name.slice(0, 1)}
                </Avatar>
                {person.email}
              </span>
            </TableCell>
            <TableCell className="text-muted-foreground">{person.role}</TableCell>
            <TableCell align="end">
              <IconButton aria-label={`More for ${person.name}`} className="ms-auto" onClick={() => onMore(person.id)}>
                <IconButtonIcon icon="ellipsis" />
              </IconButton>
            </TableCell>
          </TableRow>
        ))}
      </TableBody>
    </Table>
  );
}

API reference

Parts
PartWhat it is
TableCaptionThe table's name, its first child
TableHeaderThe header's row group (thead); put one TableRow of TableHead cells in it
TableBodyThe body's row group (tbody); put one TableRow per record in it, keyed by its record's id, or one TableGroup per group
TableFooterThe table's foot (tfoot), after the body, pinned at the frame's foot while the rows scroll (give the table a height); put a totals TableRow (a TableHead naming it, a TableCell numeric per figure) and a TableFooterBar with the pager in it, either or both
TableFooterBarThe foot's bar for the pager
TableGroupRows of a table gathered under a band, such as interviews by status
TableRowOne row (tr)
TableHeadA head cell (th)

TableBody

The body's row group (tbody); put one TableRow per record in it, keyed by its record's id, or one TableGroup per group.

TSX
import { TableBody } from '@/components/ui/goop/table';

Options

TableCaption

The table's name, its first child.

TSX
import { TableCaption } from '@/components/ui/goop/table';

Options

TableGroup

Rows of a table gathered under a band, such as interviews by status.

TSX
import { TableGroup } from '@/components/ui/goop/table';

Options

  • value: string — The group's key (its status, its person's id): the table keeps the group's fold by it.
  • title: string — The group's name, on the band and as its caret's spoken name.
  • count?: number — How many rows the group holds, after its name; left out, no count.
  • mark?: ReactNode — A mark before the name (a StatusMark, an avatar), decorative: the name says it.
  • 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 band folds or unfolds them.

Table: every option

TSX
import { Table } from '@/components/ui/goop/table';

Compose

  • Straight in an outline Card, under its CardHeader, a plain table takes the card's gutter by itself; never put it in a CardContent.
  • TableGroup: Group by one key the rows share (a status, a person), in that key's own order, each with its rows' count; leave out an empty group. A sort orders the rows inside each group.

Options

  • variant?: TableVariant = 'outline' — The look: outline, the outlined box of a settings list (the default), or plain, a comparison's rows with no box.
  • gutter?: TableGutter — A plain table's insets before its first column and after its last: none (the table's edge), page the page's 40 px gutter (a table across a page's panel), card a card's 12 px inset (a table in a Card).
  • density?: TableDensity = 'comfortable'
  • columns?: string | ReadonlyArray<string | TableColumn> — Trail's column tracks, taken so a page written for Trail compiles: Meadow sizes each column by what it holds.
  • Types: TableColumn = { track: string; hide?: 'narrow' }

TableRow

One row (tr).

TSX
import { TableRow } from '@/components/ui/goop/table';

Options

Keyboard

KeyWhat it does
TabMove to each row's menu button in turn (the comparison's plan buttons first); the table itself takes no stop
Enter/Space/ArrowDown on a row's menu buttonOpen its menu: make the person an admin or a member, or remove them
Enter/Space on a plan's buttonMake that plan the current one: its button says so and rests

Accessibility

  • The native element answers the keyboard.

Responsive behaviour

  • A column is as wide as what it holds, its words on one line: give the column that should take the room left a className="w-full" on its head (a members list's names). columns is Trail's prop: its tracks go unused, but a { track, hide: 'narrow' } column leaves under 640 px of the table's width or where the columns overflow it (a phone, a narrow panel). A row's action (a menu's IconButton) goes in the row's last cell, align="end"; the row lights under the pointer and its button takes the keyboard's Tab. Rows in groups: one TableGroup per group in the TableBody, its rows inside it; totals and the pager: a TableFooter after the body; a denser table: density="compact".

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.

goop.so/themes/meadow/components/table.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-table.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.