Patch UI

Table

A set of composable table primitives - thin, styled wrappers around native table elements with hairline dividers, a surface background, and restrained typography. Mirrors the familiar shadcn table API so the parts compose the way you expect.

$npx shadcn add @patchui/table
PlanSeatsPrice
StarterUp to 3$0
TeamUp to 20$49
EnterpriseUnlimitedCustom
Total3 plans
Pricing across available plans.

Usage

import {
  Table,
  TableHeader,
  TableBody,
  TableFooter,
  TableRow,
  TableHead,
  TableCell,
  TableCaption,
} from "@patchui/react";
 
<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Plan</TableHead>
      <TableHead align="right">Price</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Team</TableCell>
      <TableCell align="right">$49</TableCell>
    </TableRow>
  </TableBody>
</Table>

Props

Table

PropTypeDefaultDescription
scrollablebooleantrueWrap the table in a horizontally-scrollable container so wide tables stay usable on narrow viewports.
classNamestring-Additional CSS classes applied to the table element.

TableHead / TableCell

PropTypeDefaultDescription
align"left" | "center" | "right""left"Text alignment for the cell. Right-aligned TableCells also apply tabular-nums for column-aligned numerals.
classNamestring-Additional CSS classes applied to the cell.

Notes

  • Composition: Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, and TableCaption map directly to the native table elements, so standard HTML attributes pass through.
  • Numerals: Use align="right" on numeric TableCells to right-align and enable tabular figures for clean column alignment.
  • Key/value pairs: For simple two-column key/value data, a two-cell TableRow per pair works well; reserve the header row for true tabular data.