Table

Semantic structure for rows and columns. Your application owns the data behavior.

Interactive preview

Live specimenTry the component
Sample projects
ProjectStatusOwner
AtlasActiveAlex Kim
MeridianIn reviewSam Rivera
FormaActiveJordan Lee

Installation

Add editable source to an initialized React project. Set up antiflex/ui first if you are new here.

Terminal
npx antiflex-ui@0.1.0-alpha.2 add table

This site previews the latest workspace styles and motion. The published alpha keeps its released styles until the next npm release.

Usage

React
<Table>
  <TableCaption>Sample projects</TableCaption>
  <TableHeader>
    <TableRow><TableHead>Project</TableHead></TableRow>
  </TableHeader>
  <TableBody>
    <TableRow><TableCell>Atlas</TableCell></TableRow>
  </TableBody>
</Table>

API reference

All components forward native attributes, className, and refs to their underlying elements.

PropTypeDefault
TableNative table attributes + ref—
TableHeadNative th attributes + refscope="col"
TableCellNative td attributes + ref—
PartsHeader, Body, Row, Head, Cell, Caption—

Accessibility

Use a caption and column or row headers. Put a native button in sortable headers and set aria-sort on the th. Wrap wide tables in a scrollable region.