Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Table

A responsive table component.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
Total$1,200.00

Installation

npx logic2b@latest add table

Usage

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>

API

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.

Component Renders Notes
Table <table> Wrapped in an overflow-x container
TableHeader <thead>
TableBody <tbody>
TableFooter <tfoot> Muted background, top border
TableRow <tr> Supports data-state="selected"
TableHead <th> Column header cell
TableCell <td> Body cell
TableCaption <caption> Rendered below the table

All accept className and the standard props of the element they render.

Examples

With status

NameRoleStatus
Olivia MartinOwnerActive
Jackson LeeMemberActive
Isabella NguyenMemberInvited

Simple

ItemQtyPrice
Keyboard2$180.00
Monitor1$320.00
Mouse3$150.00