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.
| Invoice | Method | Status | Amount |
|---|---|---|---|
| INV-001 | Credit Card | Paid | $250.00 |
| INV-002 | PayPal | Pending | $150.00 |
| INV-003 | Bank Transfer | Unpaid | $350.00 |
| INV-004 | Credit Card | Paid | $450.00 |
Status with Badge
Common pattern: status column uses Badge plain so it does not dominate the row.
| Order | Customer | Status |
|---|---|---|
| ORD-1042 | Olivia Martin | Fulfilled |
| ORD-1041 | Jackson Lee | Processing |
| ORD-1040 | Isabella Nguyen | Refunded |
Row actions
A trailing column holds a DropdownMenu per row for Edit, Duplicate, and Delete actions.
| Name | Role | Actions | |
|---|---|---|---|
| Olivia Martin | olivia@example.com | Owner | |
| Jackson Lee | jackson@example.com | Editor | |
| Isabella Nguyen | isabella@example.com | Viewer |
Empty state
Use TableEmpty when there is no data. The colspan must match the column count.
| Invoice | Method | Amount |
|---|---|---|
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>