Table

A structured data table with header, body, and optional footer. Supports zebra striping, row selection, sortable columns, and pagination.

Anatomy
<Table striped>
  <TableHeader>
    <TableRow>
      <TableHead sortable sortDirection="asc" onSort={…}>Column</TableHead>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow selected onClick={…}>
      <TableCell>Value</TableCell>
    </TableRow>
  </TableBody>
  <TableFooter>   {/* optional */}
    <TableRow>…</TableRow>
  </TableFooter>
</Table>

Examples

NameEmailRoleStatusJoined
Haydn Phillipshaydn@example.comAdminActiveJan 2024
Jamie Daviesjamie@example.comMemberActiveMar 2024
Sara Kimsara@example.comMemberInactiveJun 2024
Alex Morganalex@example.comViewerPendingSep 2024
Jordan Leejordan@example.comMemberActiveNov 2024

Zebra striping

NameRoleStatusJoined
Haydn PhillipsAdminActiveJan 2024
Jamie DaviesMemberActiveMar 2024
Sara KimMemberInactiveJun 2024
Alex MorganViewerPendingSep 2024
Jordan LeeMemberActiveNov 2024

Sortable columns

NameRoleStatusJoined
Haydn PhillipsAdminActiveJan 2024
Jamie DaviesMemberActiveMar 2024
Sara KimMemberInactiveJun 2024
Alex MorganViewerPendingSep 2024
Jordan LeeMemberActiveNov 2024

Row selection

1 row selected

NameRoleStatus
Haydn PhillipsAdminActive
Jamie DaviesMemberActive
Sara KimMemberInactive
Alex MorganViewerPending
Jordan LeeMemberActive

With footer

InvoiceStatusAmount
INV-001Paid$1,200.00
INV-002Pending$450.00
INV-003Paid$3,050.00
INV-004Overdue$890.00
Total$5,590.00

Clickable rows

NameRoleStatus
Haydn PhillipsAdminActive
Jamie DaviesMemberActive
Sara KimMemberInactive
Alex MorganViewerPending
Jordan LeeMemberActive

With pagination

NameRoleStatus
Haydn PhillipsAdminActive
Jamie DaviesMemberActive
Sara KimMemberInactive
13 of 5

Table props

children*
ReactNode
Table sections.
striped= false
boolean
Alternating row background colour.
className
string
Additional classes on the table element.

TableRow props

children*
ReactNode
TableHead or TableCell elements.
selected
boolean
Applies accent-subtle highlight to the row.
onClick
() => void
Makes the row clickable with hover state.
className
string
Additional classes.

TableHead props

children
ReactNode
Header cell content.
align= 'left'
'left' | 'center' | 'right'
Text alignment.
sortable
boolean
Shows sort icon and enables click interaction.
sortDirection
'asc' | 'desc' | null
Current sort state.
onSort
() => void
Called when the column header is clicked.
className
string
Additional classes.

TableCell props

children
ReactNode
Cell content.
align= 'left'
'left' | 'center' | 'right'
Text alignment.
colSpan
number
Number of columns to span.
className
string
Additional classes.