Codeways UI
Browse components

Data display

Table

Hand-authored tables for fixed, small lists.

@codeways/ui/table

Table primitives

Hand-authored tables for fixed, small lists - reach for DataTable once rows need sorting, filtering or paging state.

ClientDateAmountStatus
INV-000191Lanka Tea ExportsAUD1,850.00Paid
INV-000192Globex DigitalUSD4,200.00Partially paid
INV-000193Colombo Freight CoLKR612,500.00Overdue by 12 days

Density

`data-density` on `<table>`, read by every `TableCell` in the group.

InvoiceAmount
INV-000191AUD1,850.00
INV-000192USD4,200.00
INV-000193LKR612,500.00

Usage

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

<Table density="comfortable">
  <TableHeader>
    <TableRow>
      <SortableHead label="Invoice" sort={sort} onSort={toggleSort} />
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    {invoices.map((invoice) => (
      <TableRow key={invoice.id}>
        <TableCell>{invoice.number}</TableCell>
        <TableCell className="text-right">
          <Money amount={invoice.amount} currency={invoice.currency} />
        </TableCell>
      </TableRow>
    ))}
  </TableBody>
</Table>