Table

Displays structured rows and columns with contextual headers, footers, selected rows, and pinned cells.

Overview

The Table component provides styled native table primitives. The table itself stays transparent and structural, while headers, footers, selected rows, and pinned cells derive their surfaces and borders from the current surface context.

Usage

import {
  Table,
  TableBody,
  TableCell,
  TableFooter,
  TableHead,
  TableHeader,
  TableRow,
} from "@tilt-legal/cubitt-components/table";
<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Invoice</TableHead>
      <TableHead>Status</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell className="font-medium">INV001</TableCell>
      <TableCell>Paid</TableCell>
      <TableCell className="text-right">$250.00</TableCell>
    </TableRow>
  </TableBody>
</Table>

Examples

Basic

A simple table with a header, body, and footer.

Selected Rows

Use data-state="selected" on a row or cell when the row is selected.

Pinned Column

Pinned cells use data-pinned and data-last-col so their background and separator border stay opaque while horizontally scrolling.

API Reference

Components

ComponentElementDescription
TabletableWraps a native table in a horizontal overflow container.
TableHeadertheadHeader row group.
TableBodytbodyBody row group with spacing from the header.
TableFootertfootFooter row group with a contextual surface and border.
TableRowtrTable row. Supports data-state="selected".
TableHeadthHeader cell with contextual surface and border.
TableCelltdBody or footer cell. Supports data-state="selected" and data-pinned.
TableCaptioncaptionCaption text for the table.

On this page