Table

React Table components are used to display structured data in rows and columns. They are commonly used for lists, reports, dashboards, admin panels, and data-heavy interfaces where content needs to be easy to scan and compare.

This Table component is built with React and styled using Tailwind CSS. It provides composable table parts, responsive horizontal scrolling, and flexible styling while keeping native table semantics.

ProductPriceStock
Laptop$999In Stock
Mouse$29.99In Stock
Keyboard$79.99Low Stock

Installation

Install the component using the Tailgrids CLI.

npx @tailgrids/cli add table

Anatomy

Import the table parts and compose them to build the layout.

import {
  TableRoot,
  TableHeader,
  TableBody,
  TableHead,
  TableRow,
  TableCell
} from "@/registry/core/table";

export default TablePreview = () => (
  <TableRoot>
    <TableHeader>
      <TableRow>
        <TableHead />
      </TableRow>
    </TableHeader>
    <TableBody>
      <TableRow>
        <TableCell />
      </TableRow>
    </TableBody>
  </TableRoot>
);

Usage

import {
  TableRoot,
  TableHeader,
  TableBody,
  TableHead,
  TableRow,
  TableCell
} from "@/registry/core/table";

export default function TableExample() {
  return (
    <TableRoot>
      <TableHeader>
        <TableRow>
          <TableHead>Header</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell>Cell</TableCell>
        </TableRow>
      </TableBody>
    </TableRoot>
  );
}

Examples

Full Bleed

The fullBleed prop removes rounded corners and side borders, making the table span the full width of its container. This is useful for edge-to-edge layouts.

ProductPriceStock
Laptop$999In Stock
Mouse$29.99In Stock
Keyboard$79.99Low Stock

Recent Orders

A dashboard widget style table for displaying recent orders with product thumbnails and "See All" navigation.

Recent Orders

ProductsCategoryDatePriceStatus
Macbook pro 13”
Macbook pro 13”
2 Variants
LaptopNov 23, 01:00 PM$2399.00Delivered
Apple Watch Ultra
Apple Watch Ultra
1 Variants
WatchNov 22, 09:00 PM$879.00Pending
iPhone 15 Pro Max
iPhone 15 Pro Max
2 Variants
Smart PhoneOct 12, 03:54 PM$1869.00Delivered
iPad Pro 3rd Gen
iPad Pro 3rd Gen
2 Variants
ElectronicsSep 09, 02:00 AM$1699.00Canceled
Airpods Pro 2nd Gen
Airpods Pro 2nd Gen
1 Variants
AccessoriesFeb 35, 08:00 PM$240.00Delivered

Order History

An order history table that displays order status with color-coded badges and includes a sorting interface.

Order History

Review all your past purchases in one convenient place.

Order IDCustomer NameProductAmount
Status
Order Date
#ORD-10245Musharof ChowdhuryNoise Buds Pro$79.99Shipped2025-03-11
#ORD-10246Johurul HaqueMacBook Air M2$1,199Pending2025-03-18
#ORD-10247Ahmed FaisalDell XPS 13$999Cancelled2025-02-27
#ORD-10248Ahmed TusarApple Watch SE$249Shipped2025-04-01

Transactions

A financial transactions table including category icons, price formatting, and status indicators.

Latest Transactions

NameDatePriceCategoryStatus
P
Bought PYPL
Nov 23, 01:00 PM$2,567.88FinanceSuccess
A
Bought AAPL
Nov 22, 09:00 PM$3,987.45TechnologyFailed
K
Sell KKST
Oct 12, 03:54 PM$6,754.99FinanceSuccess
f
Bought FB
Sep 09, 02:00 AM$1,445.41Social mediaPending
a
Sell AMZN
Feb 05, 08:00 PM$5,698.55E-commerceSuccess

API Reference

TableRoot

Wraps the entire table and manages layout and overflow behavior. Extends native table element props.

PropTypeDefaultDescription
fullBleedbooleanfalseRemove rounded corners for edge-to-edge layout
classNamestring-Additional CSS classes

TableHeader

The table header container. Extends thead element props.

PropTypeDescription
classNamestringAdditional CSS classes

TableBody

The table body container. Extends tbody element props.

PropTypeDescription
classNamestringAdditional CSS classes

TableHead

A table header cell. Extends th element props.

PropTypeDescription
classNamestringAdditional CSS classes

TableRow

A table row. Extends tr element props.

PropTypeDescription
classNamestringAdditional CSS classes

TableCell

A table data cell. Extends td element props.

PropTypeDescription
classNamestringAdditional CSS classes

Accessibility

  • Uses native table elements (table, thead, tbody, tr, th, td)
  • Header cells use <th> for proper screen reader context
  • Left-aligned text for better readability
  • Horizontal scroll container for responsive behavior
  • Supports all standard table HTML attributes