Toggle Sidebar B
header.lightDarkMode D

Table

Table primitives for static data. For sort, filter, search, and pagination out of the box, use TableData (documented separately).

Anatomy

Import all parts and piece them together.

vue
<script setup>
import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableFooter,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table";
</script>

<template>
  <Table>
    <TableCaption />
    <TableHeader>
      <TableRow>
        <TableHead />
      </TableRow>
    </TableHeader>
    <TableBody>
      <TableRow>
        <TableCell />
      </TableRow>
    </TableBody>
    <TableFooter />
  </Table>
</template>

Default

Table with Header and Body.

InvoiceMethodStatusAmount
INV-001Credit CardPaid$250.00
INV-002PayPalPending$150.00
INV-003Bank TransferUnpaid$350.00
INV-004Credit CardPaid$450.00

Status with Badge

Common pattern: status column uses Badge plain so it does not dominate the row.

OrderCustomerStatus
ORD-1042Olivia Martin
Fulfilled
ORD-1041Jackson Lee
Processing
ORD-1040Isabella Nguyen
Refunded

Empty state

Use TableEmpty when there is no data. The colspan must match the column count.

InvoiceMethodAmount
No invoices yet. Create one to get started.

API Reference

Props, events, and slots for each sub-component.

Table

Props

PropTypeDefaultDescription
classstringMain container. Already wrapped in relative w-full overflow-auto.

TableHead / TableCell

Props

PropTypeDefaultDescription
classstringOverride alignment (text-right, text-center) or width.

TableEmpty

Props

PropTypeDefaultDescription
colspannumber1Must match the number of columns in the header.

TableHeader / TableBody / TableFooter / TableRow / TableCaption

Props

PropTypeDefaultDescription
classstringSemantic table sections. Render the matching thead/tbody/tfoot/tr/caption with design-system styling.