Skip to content

Table

Status: stableAccessibility reviewedtenet-ui@0.4.0
Import
import { Table } from 'tenet-ui';

Also accepts every prop of TableHTMLAttributes<HTMLTableElement>.

Source: src/components/Table/Table.tsx

When to use: to present rows of structured, comparable data (repos, users, runs). Use the Table family — real <table> semantics — not a grid of styled <div>s.

  • Compose Table.HeadTable.RowTable.Header for the header, and Table.BodyTable.RowTable.Cell for data. Header cells are real <th scope="col"> for screen readers.
  • Wrap in Table.Container with Table.Title / Table.Subtitle when the table needs a heading or actions — don’t hand-build a bordered header.
  • Use density (condensed | normal | spacious) for row height; never set row padding inline.
  • Use align="end" on numeric columns (header and cells) so figures line up.
  • For sortable columns set sortDirection on the Table.Header (it renders the indicator and aria-sort) and handle onClick.
  • When the collection has zero records, render an EmptyState in place of the table; an empty filter result is one Table.Cell message inside the table.
  • Never hardcode borders, row striping, or padding — they come from borderColor, bgColor, and the space scale.
  • <Table.Header align="end" sortDirection="descending">Stars</Table.Header>
  • <div className="row" style={{ display: 'flex', borderBottom: '1px solid #d0d7de' }}> — not a table, hardcoded border, no semantics.

See also: DataTable when users sort, search, or filter; EmptyState; system guideline data-display.

4 stories for Table — open in Storybook

The full matrix (all args, controls, accessibility panel) is in Storybook.

Table

PropTypeDefaultDescription
density'condensed' | 'normal' | 'spacious'
TableDensity
normalRow height / cell padding scale.
childrenReactNode

Table.Container

PropTypeDefaultDescription
childrenReactNode

Table.Title

PropTypeDefaultDescription
childrenReactNode

Table.Subtitle

PropTypeDefaultDescription
childrenReactNode

Table.Actions

PropTypeDefaultDescription
childrenReactNode

Table.Head

PropTypeDefaultDescription
childrenReactNode

Table.Body

PropTypeDefaultDescription
childrenReactNode

Table.Row

PropTypeDefaultDescription
childrenReactNode

Table.Header

PropTypeDefaultDescription
align'start' | 'center' | 'end'
CellAlign
startText alignment within the header cell.
sortDirection'ascending' | 'descending' | 'none'
SortDirection
When set, renders a sort indicator and exposes aria-sort. Combine with onClick.
childrenReactNode

Table.Cell

PropTypeDefaultDescription
align'start' | 'center' | 'end'
CellAlign
startText alignment within the cell.
childrenReactNode