Table

Semantic, responsive tables with soft row hover and an animated selection marker.

Data Display
Invoices issued in October.
InvoiceCustomerStatusMethodAmount
INV-2041NorthwindPaidCard$1,250.00
INV-2042GlobexPendingTransfer$480.00
INV-2043InitechPaidCard$2,900.00
INV-2044UmbrellaOverdueTransfer$760.00
INV-2045HooliPaidCard$1,840.00
Total$7,230.00

Playground

Tweak the props, the preview and the code follow.

InvoiceCustomerStatusAmount
INV-2041NorthwindPaid€1,240
INV-2042LumenPending€380
INV-2043ParcelPaid€2,900
INV-2044FieldnoteOverdue€610
Props
4
<Table>
  <TableHeader>
    <TableRow>
      <TableHead><Checkbox aria-label="Select all" /></TableHead>
      <TableHead>Invoice</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow data-state="selected">
      <TableCell><Checkbox checked /></TableCell>
      <TableCell>INV-2041</TableCell>
      <TableCell className="text-right">€1,240</TableCell>
    </TableRow>
  </TableBody>
</Table>

Installation

npx @plumsydev/plum-ui add table

Also pulls in badge automatically.

Usage

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table"
<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Invoice</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>INV-2041</TableCell>
      <TableCell className="text-right">$1,250.00</TableCell>
    </TableRow>
  </TableBody>
</Table>

Examples

Selectable rows

Set data-state="selected" on a row to highlight it and grow the accent bar.

NameEmailRole
Léa Martinlea@acme.comOwner
Noah Kimnoah@acme.comAdmin
Sam Ortizsam@acme.comMember
Ava Chenava@acme.comMember

1 of 4 selected

Animated sorting

Wrap rows with motion.create(TableRow) and layout to animate reordering.

acme-api961,20041ms
acme-web182,40084ms
acme-docs24,800112ms
acme-admin8,30067ms

API Reference

TableRow

A styled tr.

PropTypeDefault
data-state

Highlights the row and reveals the accent bar.

"selected"—

Notes

  • The table is wrapped in a horizontally scrollable container, so wide tables never break the layout on mobile.
  • For sorting, filtering and pagination logic, pair it with TanStack Table.