---
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>/trail-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 { TableCell, TableCellLabel, TableCellSort, TableCellButton, TableCellValue, TableCellIndicator, TableCellIndicatorDot, TableCellPerson } from '@/components/ui/goop/table-cell';
import { Table, TableHeader, TableRow, TableHead, TableBody } from '@/components/ui/goop/table';
import { Badge, BadgeIcon, BadgeLabel } from '@/components/ui/goop/badge';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';

<Table columns="minmax(200px, 1fr) minmax(160px, 1fr) auto 120px 40px" aria-label="Invoices">
  <TableHeader>
    <TableRow>
      <TableHead>
        <TableCellLabel>Invoice</TableCellLabel>
      </TableHead>
      <TableHead>
        <TableCellLabel>Owner</TableCellLabel>
      </TableHead>
      <TableHead>
        <TableCellLabel>Status</TableCellLabel>
      </TableHead>
      <TableHead numeric sorted="descending">
        <TableCellSort>Amount</TableCellSort>
      </TableHead>
      <TableHead align="end" aria-label="Actions" />
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>
        <TableCellLabel primary>2026-0147</TableCellLabel>
      </TableCell>
      <TableCell>
        <TableCellPerson name="Siddharth Venkataraman" description="siddharth@fieldwork.test" />
      </TableCell>
      <TableCell>
        <Badge variant="warning">
          <BadgeIcon icon="alert-triangle" />
          <BadgeLabel>Due soon</BadgeLabel>
        </Badge>
      </TableCell>
      <TableCell numeric>
        <TableCellLabel>1,284.50</TableCellLabel>
      </TableCell>
      <TableCell align="end">
        <IconButton variant="ghost" size="sm" aria-label="Actions for 2026-0147">
          <IconButtonIcon icon="dots" />
        </IconButton>
      </TableCell>
    </TableRow>
  </TableBody>
</Table>
```

- Fits: list, states (their recipes).
- 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 `div` (a `td`, a `th`).
- `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 cutting them with an ellipsis at the column's end.

### 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 strong ink of a `TableCellPerson`'s name
- `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

- Class recipes (cva): tableCellVariants (TableCell)

### 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, hidden until the pointer, the press or the focus comes (shown at rest on a touch screen).
- Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean

## Accessibility

- The native element answers the keyboard.
- hover, active, focus-visible, focus-within: the browser's own (:hover, :active, :focus-visible, :focus-within): 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/trail/components/table): A data table of records compared across columns, with a header row whose columns can sort.
- [Badge](/themes/trail/components/badge): A small pill with a word, an icon or a count, for a status, a tag or a label beside a title or in a row.
- [Icon button](/themes/trail/components/icon-button): A button whose only visible label is one icon, for toolbars, rows and headers.
- [Table selection](/themes/trail/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.
