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@next 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>

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

NameRoleStatus
Olivia MartinOwnerActive
Jackson LeeMemberActive
Isabella NguyenMemberInvited

Simple

ItemQtyPrice
Keyboard2$180.00
Monitor1$320.00
Mouse3$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>

API reference

Generated from the public TypeScript exports in src/ui/table.tsx.

View JSON

Table

Component
Props: TableProps
PropTypeRequiredDefaultDescription
containerPropsReact.ComponentProps<"div">No—Label and focus a scrolling table region when its content needs overflow.

TableHeader

Component
Props: React.ComponentProps<"thead">

TableBody

Component
Props: React.ComponentProps<"tbody">

TableFooter

Component
Props: React.ComponentProps<"tfoot">

TableHead

Component
Props: React.ComponentProps<"th">

TableRow

Component
Props: React.ComponentProps<"tr">

TableCell

Component
Props: React.ComponentProps<"td">

TableCaption

Component
Props: React.ComponentProps<"caption">

Accessibility contract

Machine-readable behavior and consumer responsibilities for table.

View JSON
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.