Table

A native table in parts, a header row over body rows, solid with base corners by default.

NameUserDateAmount
Item 1User 1Mar 12, 2026$250.00
Item 2User 2Mar 10, 2026$150.00
Item 3User 3Mar 4, 2026$350.00
Item 4User 4Feb 28, 2026$450.00
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@produkto/ui/Table";

const rows: { name: string; user: string; date: string; amount: string }[] = [
  { name: "Item 1", user: "User 1", date: "Mar 12, 2026", amount: "$250.00" },
  { name: "Item 2", user: "User 2", date: "Mar 10, 2026", amount: "$150.00" },
  { name: "Item 3", user: "User 3", date: "Mar 4, 2026", amount: "$350.00" },
  { name: "Item 4", user: "User 4", date: "Feb 28, 2026", amount: "$450.00" },
];

const Example = () => (
  <div className="w-full max-w-2xl">
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead>Name</TableHead>
          <TableHead>User</TableHead>
          <TableHead>Date</TableHead>
          <TableHead>Amount</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        {rows.map((row) => (
          <TableRow key={row.name}>
            <TableCell>{row.name}</TableCell>
            <TableCell>{row.user}</TableCell>
            <TableCell>{row.date}</TableCell>
            <TableCell>{row.amount}</TableCell>
          </TableRow>
        ))}
      </TableBody>
    </Table>
  </div>
);

export default Example;

Usage

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@produkto/ui/Table";
<Table>
  <TableCaption>Description</TableCaption>
  <TableHeader>
    <TableRow>
      <TableHead className="w-25">Name</TableHead>
      <TableHead>Status</TableHead>
      <TableHead>Method</TableHead>
      <TableHead className="text-end">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Item 1</TableCell>
      <TableCell>Paid</TableCell>
      <TableCell>Option A</TableCell>
      <TableCell className="text-end">$250.00</TableCell>
    </TableRow>
  </TableBody>
</Table>

Examples

Appearances

appearance paints the table's ground on the kit's one scale: solid, the default, soft on the grey wash, outline with only its line, and transparent with neither.

SolidAmount
Item 1$250.00
Item 2$150.00
SoftAmount
Item 1$250.00
Item 2$150.00
OutlineAmount
Item 1$250.00
Item 2$150.00
TransparentAmount
Item 1$250.00
Item 2$150.00
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
  type TableAppearance,
} from "@produkto/ui/Table";

const appearances: { appearance: TableAppearance; label: string }[] = [
  { appearance: "solid", label: "Solid" },
  { appearance: "soft", label: "Soft" },
  { appearance: "outline", label: "Outline" },
  { appearance: "transparent", label: "Transparent" },
];

const rows: { name: string; amount: string }[] = [
  { name: "Item 1", amount: "$250.00" },
  { name: "Item 2", amount: "$150.00" },
];

const Example = () => (
  <div className="flex w-full max-w-2xl flex-col gap-4">
    {appearances.map((item) => (
      <Table appearance={item.appearance} key={item.appearance}>
        <TableHeader>
          <TableRow>
            <TableHead>{item.label}</TableHead>
            <TableHead>Amount</TableHead>
          </TableRow>
        </TableHeader>
        <TableBody>
          {rows.map((row) => (
            <TableRow key={row.name}>
              <TableCell>{row.name}</TableCell>
              <TableCell>{row.amount}</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    ))}
  </div>
);

export default Example;

Sizes

size sets how dense the rows are: sm 8px around each cell with 12px words, base 12px with 14px words (the default), or lg 16px with 16px words, and the head, the footer, an empty row and loading rows follow.

SmallAmount
Item 1$250.00
Item 2$150.00
BaseAmount
Item 1$250.00
Item 2$150.00
LargeAmount
Item 1$250.00
Item 2$150.00
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
  type TableSize,
} from "@produkto/ui/Table";

const sizes: { size: TableSize; label: string }[] = [
  { size: "sm", label: "Small" },
  { size: "base", label: "Base" },
  { size: "lg", label: "Large" },
];

const rows: { name: string; amount: string }[] = [
  { name: "Item 1", amount: "$250.00" },
  { name: "Item 2", amount: "$150.00" },
];

const Example = () => (
  <div className="flex w-full max-w-2xl flex-col gap-4">
    {sizes.map((item) => (
      <Table key={item.size} size={item.size}>
        <TableHeader>
          <TableRow>
            <TableHead>{item.label}</TableHead>
            <TableHead>Amount</TableHead>
          </TableRow>
        </TableHeader>
        <TableBody>
          {rows.map((row) => (
            <TableRow key={row.name}>
              <TableCell>{row.name}</TableCell>
              <TableCell>{row.amount}</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    ))}
  </div>
);

export default Example;

Border radius

borderRadius sets its corners on the kit's one scale: none, xs 4px, sm 6px, base 8px (the default), lg 12px or xl 16px.

noneAmount
Item 1$250.00
Item 2$150.00
xsAmount
Item 1$250.00
Item 2$150.00
smAmount
Item 1$250.00
Item 2$150.00
baseAmount
Item 1$250.00
Item 2$150.00
lgAmount
Item 1$250.00
Item 2$150.00
xlAmount
Item 1$250.00
Item 2$150.00
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
  type TableBorderRadius,
} from "@produkto/ui/Table";

const radii: TableBorderRadius[] = ["none", "xs", "sm", "base", "lg", "xl"];

const rows: { name: string; amount: string }[] = [
  { name: "Item 1", amount: "$250.00" },
  { name: "Item 2", amount: "$150.00" },
];

const Example = () => (
  <div className="flex w-full max-w-2xl flex-col gap-4">
    {radii.map((borderRadius) => (
      <Table key={borderRadius} borderRadius={borderRadius}>
        <TableHeader>
          <TableRow>
            <TableHead>{borderRadius}</TableHead>
            <TableHead>Amount</TableHead>
          </TableRow>
        </TableHeader>
        <TableBody>
          {rows.map((row) => (
            <TableRow key={row.name}>
              <TableCell>{row.name}</TableCell>
              <TableCell>{row.amount}</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    ))}
  </div>
);

export default Example;

Sort

onSortChange makes a TableHead a menu of Ascending and Descending, and sort marks the way the rows run: asc, desc or none, the default; the rows are the caller's to order.

Item 4$450.00
Item 3$350.00
Item 1$250.00
Item 2$150.00
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
  type TableSort,
} from "@produkto/ui/Table";
import { useState } from "react";

const rows: { name: string; amount: number }[] = [
  { name: "Item 1", amount: 250 },
  { name: "Item 2", amount: 150 },
  { name: "Item 3", amount: 350 },
  { name: "Item 4", amount: 450 },
];

const Example = () => {
  const [sort, setSort] = useState<{
    key: "name" | "amount";
    order: TableSort;
  }>({ key: "amount", order: "desc" });
  const sorted = [...rows].sort((a, b) => {
    const ahead =
      sort.key === "name" ? a.name.localeCompare(b.name) : a.amount - b.amount;
    return sort.order === "asc" ? ahead : -ahead;
  });

  return (
    <div className="w-full max-w-2xl">
      <Table>
        <TableHeader>
          <TableRow>
            <TableHead
              sort={sort.key === "name" ? sort.order : "none"}
              onSortChange={(order) => setSort({ key: "name", order })}
            >
              Name
            </TableHead>
            <TableHead
              sort={sort.key === "amount" ? sort.order : "none"}
              onSortChange={(order) => setSort({ key: "amount", order })}
            >
              Amount
            </TableHead>
          </TableRow>
        </TableHeader>
        <TableBody>
          {sorted.map((row) => (
            <TableRow key={row.name}>
              <TableCell>{row.name}</TableCell>
              <TableCell>{`$${row.amount.toFixed(2)}`}</TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </div>
  );
};

export default Example;

Loading

While the rows load, the body holds rows of Skeleton under the same headers, and aria-busy tells screen readers so.

NameUserDateAmount
import { Skeleton } from "@produkto/ui/Skeleton";
import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@produkto/ui/Table";

const columns: string[] = ["Name", "User", "Date", "Amount"];

const rows: number[] = [1, 2, 3, 4];

const Example = () => (
  <div className="w-full max-w-2xl">
    <Table aria-busy="true">
      <TableHeader>
        <TableRow>
          {columns.map((column) => (
            <TableHead key={column}>{column}</TableHead>
          ))}
        </TableRow>
      </TableHeader>
      <TableBody>
        {rows.map((row) => (
          <TableRow key={row}>
            {columns.map((column) => (
              <TableCell key={column}>
                <Skeleton className="h-4" />
              </TableCell>
            ))}
          </TableRow>
        ))}
      </TableBody>
    </Table>
  </div>
);

export default Example;

Empty

With no rows, TableEmpty spans every column and says so in a transparent NotFound, its words alone with no box.

NameUserDateAmount
No items found
import {
  Table,
  TableBody,
  TableEmpty,
  TableHead,
  TableHeader,
  TableRow,
} from "@produkto/ui/Table";

const columns: string[] = ["Name", "User", "Date", "Amount"];

const Example = () => (
  <div className="w-full max-w-2xl">
    <Table>
      <TableHeader>
        <TableRow>
          {columns.map((column) => (
            <TableHead key={column}>{column}</TableHead>
          ))}
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableEmpty colSpan={columns.length}>No items found</TableEmpty>
      </TableBody>
    </Table>
  </div>
);

export default Example;

API Reference

Table

TableProps · components/Table/Table.types.ts
PropTypeDefault
appearanceTableAppearance"solid" | "soft" | "outline" | "transparent""solid"
sizeTableSize"sm" | "base" | "lg""base"
borderRadiusTableBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl""base"

TableHeader

TableHeaderProps · takes the props of <thead>

TableBody

TableBodyProps · takes the props of <tbody>

TableFooter

TableFooterProps · takes the props of <tfoot>

TableRow

TableRowProps · takes the props of <tr>

TableHead

TableHeadProps · also takes the props of <th>
PropTypeDefault
sortTableSort"asc" | "desc" | "none""none"
onSortChange(sort: Exclude<TableSort, "none">) => void(sort: Exclude<("asc" | "desc" | "none"), "none">) => void-

TableCell

TableCellProps · takes the props of <td>

TableEmpty

TableEmptyProps · takes the props of <td>

TableCaption

TableCaptionProps · takes the props of <caption>

It also takes the props of <table>.