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

Table selection

Pro

A Table whose rows a person ticks to act on many at once, with a bar of bulk actions for the picked rows, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • A Table whose rows a person ticks to act on many at once, with a bar of bulk actions for the picked rows.

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 selection 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-selection.json --yes
PROMPT
Add the Goop Table selection to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { useTableSelection } from '@/components/ui/goop/table-selection';

import { useState } from 'react';
import { Button, ButtonLabel } from '@/components/ui/goop/button';
import { DestructiveButton } from '@/components/ui/goop/destructive-button';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/ui/goop/table';
import { TableCell, TableCellLabel } from '@/components/ui/goop/table-cell';
import {
  TableSelectAll,
  TableSelection,
  TableSelectionBar,
  TableSelectRow,
} from '@/components/ui/goop/table-selection';

function Invoices() {
  const ids = ['2026-0147', '2026-0152', '2026-0158'];
  const [picked, setPicked] = useState<string[]>([]);
  return (
    <TableSelection rows={ids} value={picked} onValueChange={setPicked}>
      <Table aria-label="Invoices">
        <TableHeader>
          <TableRow>
            <TableSelectAll />
            <TableHead className="w-full">Invoice</TableHead>
          </TableRow>
        </TableHeader>
        <TableBody>
          {ids.map((id) => (
            <TableRow key={id}>
              <TableSelectRow value={id} aria-label={`Select ${id}`} />
              <TableCell>
                <TableCellLabel>{id}</TableCellLabel>
              </TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
      <TableSelectionBar>
        <Button size="sm" onClick={() => setPicked([])}>
          <ButtonLabel>Mark as paid</ButtonLabel>
        </Button>
        <DestructiveButton size="sm" icon="trash" onClick={() => setPicked([])}>
          Delete
        </DestructiveButton>
      </TableSelectionBar>
    </TableSelection>
  );
}
  • Fits: list: collection.
  • Also known as: RowSelection, BulkActions, SelectionBar, BatchActions, SelectAll.
  • Put the box cells first in each row of a list page's Table: the boxes stand on the table's start inset (the outlined box's 14 px, a plain table's page gutter or card inset) and the first column's words 8 px after them, whatever is picked, with reveal too. Not for a list of line rows (Item variant="line" with ItemControl), not to open one record (ListDetail), not for a form's choice (Checkbox, RadioGroup).
  • height, width, padding, gap, corner, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
rowsreadonly string[]The shown rows' ids, in their order: select-all and a Shift range cover these.
value?readonly string[]The picked rows' ids, held by the caller.
defaultValue?readonly string[]The ids picked at first, when the caller does not hold them.
onValueChange?(value: string[]) => voidCalled with the picked ids after every change, in the rows' order.
reveal?boolean = falseA pointer behaviour: the boxes hidden at rest, shown under a row's pointer, under the keyboard, when checked and on every row once any row is picked; on a phone's width or a touch screen they still always show.
  • State: value (value / defaultValue / onValueChange); drawn by data-empty
Parts
PartWhat it is
TableSelectAllThe header's box
TableSelectRowA row's box; its props: table-selection--table-select-row.md
TableSelectionBarThe bar of actions on the picked rows; its props: table-selection--bar.md
useTableSelectionThe selection a part sits in, read from inside a TableSelection (an action in the bar, a dialog it opens)

TableSelectionBar

The bar of actions on the picked rows.

TSX
import { TableSelectionBar } from '@/components/ui/goop/table-selection';

Options

  • countLabel?: (count: number) => string — The count's words for a number of picked rows; "{n} selected" by default.
  • clearLabel?: string — The clear button's name, said by a screen reader: "Clear selection" by default.
  • onClear?: () => void — Called after the clear button unpicks every row.
  • children?: ReactNode — The actions on the picked rows.

TableSelectRow

A row's box.

TSX
import { TableSelectRow } from '@/components/ui/goop/table-selection';

Options

  • value: string — The row's id, one of the selection's rows.
  • aria-label: string — The box's name for assistive technology, naming the row ("Select INV-104").
  • disabled?: boolean = false — A row that cannot be picked: its box faded, skipped by select-all and a Shift range.

Keyboard

KeyWhat it does
TabMove from the header's box through each row's box in row order, then to the bar's controls
SpacePick or unpick the focused row, which becomes the anchor; on the header's box pick every shown row, or none when all are picked
Shift+SpaceSet every row from the anchor to the focused one to the anchor's state
EscapeUnpick every row, from the table or the bar
ArrowLeft ArrowRightMove between the bar's controls

Accessibility

  • The part itself answers the keys above.

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
emptythe attribute data-empty

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.

goop.so/themes/meadow/components/table-selection.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-table-selection.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.