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

# Table cell

One cell of a data table: a value, optionally with an icon or a picture before it, inside a row, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `TableCell`.

## Try it

Lay the amount column at the end, sort it either way or not at all, cut a long name or wrap it, leave a value empty; point at a cut name to read it whole.

The rows do not reorder: the sort control only counts (the table example sorts for real).

## When to use

- One cell of a data table: a value, optionally with an icon or a picture before it, inside a row.

## 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 cell 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-table-cell.json --yes
```

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

## Usage

```tsx
import { TableCellIndicator, TableCellIndicatorDot } from '@/components/ui/goop/table-cell';

import { useState } from 'react';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/ui/goop/table';
import {
  TableCell,
  TableCellButton,
  TableCellLabel,
  TableCellPerson,
  TableCellSort,
  type TableSort,
  TableCellValue,
} from '@/components/ui/goop/table-cell';

function Moderators() {
  const [way, setWay] = useState<TableSort>('descending');
  return (
    <Table aria-label="Moderators">
      <TableHeader>
        <TableRow>
          <TableCell variant="header">
            <TableCellLabel>Member</TableCellLabel>
          </TableCell>
          <TableHead numeric sorted={way}>
            <TableCellSort onClick={() => setWay(way === 'ascending' ? 'descending' : 'ascending')}>
              Sessions
            </TableCellSort>
          </TableHead>
          <TableHead>Role</TableHead>
          <TableHead align="end">Notes</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell>
            <TableCellPerson name="Teodora Valk" description="teodora@fieldwork.test" />
          </TableCell>
          <TableCell numeric>
            <TableCellLabel>12</TableCellLabel>
          </TableCell>
          <TableCell>
            <TableCellValue placeholder="Add a role" />
          </TableCell>
          <TableCell align="end">
            <TableCellButton aria-label="3 notes">3</TableCellButton>
          </TableCell>
        </TableRow>
      </TableBody>
    </Table>
  );
}
```

- height, width, padding, gap, corner, border, background, text, motion: add no class for these.

## API reference

### Options

- `variant: default | header = default`
- `asChild?: boolean = false` — Render the cell's look on the one child element instead of a `td` (a `td` or `th` of your own).
- `numeric?: boolean = false` — A column of numbers (amounts, counts): its figures one width each, laid at the column's end; give its head the same.
- `align?: 'start' | 'end' = 'start'` — Where the cell lays what it holds: `start` (the default), or `end`, on the column's end edge (a row's actions menu); give the column's head the same, so its words end on that edge too.
- `wrap?: boolean = false` — Wrap the cell's words onto more lines (the row grows) instead of holding them on one line.

### Parts

- `TableCellLabel` — The words in a cell, a value in a body row or a column's name in the header row; primary?: boolean = false — The row's main item: the words in the medium weight and the text colour
- `TableCellSort` — A column's sort control; its props: table-cell--sort.md
- `TableCellButton` — A control a body cell holds — a count that opens what it counts; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'
- `TableCellValue` — A name people edit in place, a button that looks like words; with placeholder its words are a hint; its props: table-cell--value.md
- `TableCellIndicator` — The box for a colour dot before the cell's name; put one TableCellIndicatorDot in it
- `TableCellIndicatorDot` — The colour dot inside TableCellIndicator, red unless you give it a colour of your own
- `TableCellPerson` — A person in a body cell; its props: table-cell--person.md

- Class recipes (cva): tableCellVariants (TableCell)

### TableCellPerson

A person in a body cell.

```tsx
import { TableCellPerson } from '@/components/ui/goop/table-cell';
```

### Options

- name: string — The person's name: the first line, and the avatar's initials and colour unless `initials` or a colour is given.
- description?: ReactNode — The second line: the person's email or role, in the grey.
- orientation?: 'vertical' | 'horizontal' = 'vertical' — `vertical` the name over the second line; `horizontal` the two on one line, a dot between them.
- image?: string — The person's picture; the initials show until it loads, and in its place if it fails.
- initials?: string — The avatar's letters, where the name's initials are wrong.
- hue?: 'blue' | 'green' | 'orange' | 'pink' | 'red' | 'yellow' | 'neutral' — A fixed avatar colour in place of the one taken from the name (`neutral`: the theme's grey).
- fill?: string — The avatar's own fill, any CSS colour (the person's own colour); wins over `hue`.
- shape?: 'circle' | 'square' = 'circle' — The avatar's shape: `circle` (the default) for a person, `square` for a company (a supplier, a client).
- href?: string — The name as a link to the person (their profile, their record).
- children?: ReactNode — With `asChild`: the one element the name is drawn on.
- Also takes: asChild?: boolean

### TableCellSort

A column's sort control.

```tsx
import { TableCellSort } from '@/components/ui/goop/table-cell';
```

### Options

- sorted?: TableSort — The column the rows are ordered by, and which way: the column header's unless given here.
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'

### TableCellValue

A name people edit in place, a button that looks like words; with placeholder its words are a hint.

```tsx
import { TableCellValue } from '@/components/ui/goop/table-cell';
```

### Options

- placeholder?: string — The words while the value is empty (no children): a hint in the placeholder grey.
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean

## Keyboard

- Tab: move to the next control a cell holds: a column head's sort, a row's editable value, its count
- Enter / Space: on a column head's sort, press it (the caller orders the rows and sets its head's sorted); on an editable value, open it; on a count, open what it counts

## Accessibility

- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
- disabled: the prop disabled

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

Shortened to fit: the data-slot values.

## Related

- [Table](/themes/meadow/components/table): A table of records compared across columns.
- [Table selection](/themes/meadow/components/table-selection): A Table whose rows a person ticks to act on many at once, with a bar of bulk actions for the picked rows.
- [Create row](/themes/meadow/components/create-row): A new item made in place in a list.
- [Board](/themes/meadow/components/board): A board of items in columns by status, for a tracker, a roadmap or a pipeline.
