Design · Components · Display

Table

A print-register data table with hairline rules and mono headers.

Radius scale of the design system.
TokenValueApplies to
--radius-control8pxButtons, inputs, menu items
--radius-surface10pxCards, popovers, panels
--radius-xl12pxDialogs, large surfaces
--radius-thread16pxThe chat viewport

Installation

Copy the source into components/ui/table.tsx. Registry items that depend on it install it automatically.

components/ui/table.tsx

Usage

import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table";

export function Example() {
  return (
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead>Token</TableHead>
          <TableHead>Value</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell>--radius-control</TableCell>
          <TableCell>8px</TableCell>
        </TableRow>
      </TableBody>
    </Table>
  );
}

The table opens with a hairline, closes with one under the last row, and draws no vertical rules or fills. The wrapper scrolls horizontally on its own, so a wide table never scrolls the page.

Examples

In articles

Markdown tables on this site render through these parts automatically; the API reference below is one.

API Reference

Every part renders its native element and accepts that element's props.

PartElementRole
TabletableScroll wrapper plus the table surface.
TableHeadertheadHeader row group.
TableBodytbodyData rows.
TableFootertfootClosing rows, set in medium weight.
TableRowtrOne row, closed by a hairline.
TableHeadthMono column label.
TableCelltdOne cell, top-aligned for multi-line content.
TableCaptioncaptionMono caption below the table.