Search documentation

Search components and pages

Table

A responsive table component.

A list of recent invoices.
InvoiceStatusAmount
INV001Paid$250.00
INV002Pending$150.00
01

Installation

Add the table component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/table.json
02

Usage

tsx
import { Table } from "@/components/ui/table"
03

Examples

With footer

TableFooter totals row
ItemAmount
Subscription$120.00
Add-ons$30.00
Total$150.00
import {
  Table,
  TableBody,
  TableCell,
  TableFooter,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table"

<Table className="w-80">
  <TableHeader>
    <TableRow>
      <TableHead>Item</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Subscription</TableCell>
      <TableCell className="text-right">$120.00</TableCell>
    </TableRow>
  </TableBody>
  <TableFooter>
    <TableRow>
      <TableCell>Total</TableCell>
      <TableCell className="text-right">$150.00</TableCell>
    </TableRow>
  </TableFooter>
</Table>