| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Credit Card | $450.00 |
| Total | $1,200.00 | ||
Installation
npx logic2b@next add tableUsage
import {
Table,
TableBody,
TableCaption,
TableCell,
TableFooter,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
<Table>
<TableCaption>A list of your recent invoices.</TableCaption>
<TableHeader>
<TableRow>
<TableHead>Invoice</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>INV001</TableCell>
</TableRow>
</TableBody>
</Table>
Usage notes
Each part is a thin wrapper over the matching HTML element and forwards its
native props. Table also wraps the <table> in a horizontally scrollable
container.
All accept className and the standard props of the element they render.
Examples
With status
| Name | Role | Status |
|---|---|---|
| Olivia Martin | Owner | Active |
| Jackson Lee | Member | Active |
| Isabella Nguyen | Member | Invited |
Simple
| Item | Qty | Price |
|---|---|---|
| Keyboard | 2 | $180.00 |
| Monitor | 1 | $320.00 |
| Mouse | 3 | $150.00 |
Live playground
Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.
Generated JSX
<Table
className="table-auto"
>
<TableHeader>
<TableRow>
<TableHead>Package</TableHead>
<TableHead>Status</TableHead>
<TableHead
className="text-right"
>Tests</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>registry</TableCell>
<TableCell>Passing</TableCell>
<TableCell
className="text-right"
>136</TableCell>
</TableRow>
<TableRow>
<TableCell>web</TableCell>
<TableCell>Passing</TableCell>
<TableCell
className="text-right"
>648</TableCell>
</TableRow>
</TableBody>
<TableCaption>Current quality-gate status.</TableCaption>
</Table>| Package | Status | Tests |
|---|---|---|
| registry | Passing | 136 |
| web | Passing | 648 |
API reference
Generated from the public TypeScript exports in src/ui/table.tsx.
Table
ComponentProps: TableProps| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
containerProps | React.ComponentProps<"div"> | No | — | Label and focus a scrolling table region when its content needs overflow. |
TableHeader
ComponentProps: React.ComponentProps<"thead">TableBody
ComponentProps: React.ComponentProps<"tbody">TableFooter
ComponentProps: React.ComponentProps<"tfoot">TableHead
ComponentProps: React.ComponentProps<"th">TableRow
ComponentProps: React.ComponentProps<"tr">TableCell
ComponentProps: React.ComponentProps<"td">TableCaption
ComponentProps: React.ComponentProps<"caption">Accessibility contract
Machine-readable behavior and consumer responsibilities for table.
- Support
- Native semantics
- Pattern
- data table
- HTML table elements
Built-in semantics
- Uses native table, row, header and cell elements.
Consumer responsibilities
- Add a caption, scope headers correctly and provide a non-visual name for interactive controls in cells.