Table

A responsive table component for displaying tabular data.

Installation

import {
  Table,
  TableBody,
  TableCaption,
  TableCell,
  TableFooter,
  TableHead,
  TableHeader,
  TableRow,
} from "@gradeui/ui"

Usage

A list of your recent projects.
DeviceStatusPower
Marketing SiteLivev2.4

Examples

Project List

Your recent projects
IDProjectStatusVersionToday
PRJ001Marketing Site
Live
v2.41,482 visits
PRJ002Mobile App
Live
v1.86,210 sessions
PRJ003Admin Dashboard
Deploying
v3.1
PRJ004API Gateway
Live
v0.92.1M requests
PRJ005Docs Portal
Live

With Footer

Daily activity summary
DateDeploysRequestsErrors
2024-01-1582.1M14
2024-01-1451.8M21
2024-01-13122.4M6
2024-01-1231.5M38
2024-01-1192.0M11
Total (5 days)379.8M90

Simple Table

MetricValue
Active users1,284
Today's sessions6,210
This month186,420
All-time12.4M

Props

PropTypeDefaultDescription
classNamestring-Additional CSS classes.

Accessibility

  • Uses native HTML table elements for semantics
  • TableCaption provides accessible description
  • TableHead cells use proper th elements
  • Supports keyboard navigation
  • Scrollable container for responsive design

Sidecar

The Markdown sidecar Studio (and the Grade MCP server, when it ships) reads to understand this component — frontmatter, when- to-use guidance, and canonical examples. Authored once at packages/ui/components/ui/table.md and shipped inside the published @gradeui/ui tarball.

---
name: Table
import: "@gradeui/ui"
subcomponents: [TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption]
props:
  - Each subcomponent accepts native table HTML attrs
  - No variants — styling follows the active theme tokens
when_to_use: Structured tabular data — rows × columns with alignment requirements. NOT a layout grid — for that use div+Tailwind grid utilities. Keep to <100 rows; larger datasets need virtualisation (not in DS).
composes_with: [Card (wrap the table), Badge (inside TableCell for status), Checkbox (row selection), Button (row actions)]
aliases: [table, table view, data table, datatable, grid view, data grid, rows and columns]
---

```jsx
<Table>
  <TableHeader>
    <TableRow>
      <TableHead>Name</TableHead>
      <TableHead className="text-right">Amount</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell>Invoice #001</TableCell>
      <TableCell className="text-right">$250</TableCell>
    </TableRow>
  </TableBody>
</Table>
```