Table
A structured data table with header, body, and footer sections.
Import
import {
Table,
TableHeader,
TableBody,
TableRow,
TableHead,
TableCell,
} from "@retents/ui/table"Usage Guidelines
When to use
- For displaying structured, tabular data with rows and columns (e.g., invoices, users, logs).
- When the data has consistent columns and users benefit from scanning across rows.
- For data that needs sorting, filtering, or alignment (right-align numbers).
When NOT to use
- For key-value pairs — use a description list (
<dl>) or Card layout. - For a single-column list of items — use a simple list or ScrollArea.
- For complex, interactive data grids with inline editing — consider a specialized data table library on top of these primitives.
Preview
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Credit Card | $450.00 |
| INV005 | Paid | PayPal | $550.00 |
Usage
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Status</TableHead>
<TableHead>Amount</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Invoice #001</TableCell>
<TableCell>Paid</TableCell>
<TableCell>$250.00</TableCell>
</TableRow>
</TableBody>
</Table>