Toggle Sidebar B
AppearanceLight & dark mode D

Table

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

Default

Table with Header and Body.

Replay preview
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.

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

Row actions

A trailing column holds a DropdownMenu per row for Edit, Duplicate, and Delete actions.

Replay preview
NameEmailRoleActions
Olivia Martinolivia@example.comOwner
Jackson Leejackson@example.comEditor
Isabella Nguyenisabella@example.comViewer

Empty state

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

Replay preview
InvoiceMethodAmount
No invoices yet. Create one to get started.

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>

API Reference

Table

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

TableHead / TableCell

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

TableEmpty

PropTypeDefaultDescription
colspannumber1Must match the number of columns in the header.

TableHeader / TableBody / TableFooter / TableRow / TableCaption

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