Skip to main content

Function: Table()

Table(props): Element

Defined in: components/Table/Table.tsx:114

A semantic data table built on React Aria's Table — column headers, keyboard grid navigation, sorting, and row selection.

Per ADR-007 the CONTAINER is Entity = Collection (an informational surface) and each TableRow is Entity = Selection (input chrome, the selected State). Compose TableHeader + TableColumn for the header and TableBody + TableRow + TableCell for the data. Sorting is controlled via sortDescriptor/onSortChange with allowsSorting on the sortable columns. Row selection uses React Aria's selectionMode; clicking a row toggles it (there is no checkbox column yet — it ships when a consumer demands bulk actions).

Parameters

ParameterType
propsTableProps

Returns

Element

Example

<Table aria-label="Team" sortDescriptor={sort} onSortChange={setSort}>
<TableHeader>
<TableColumn id="name" isRowHeader allowsSorting>Name</TableColumn>
<TableColumn id="role">Role</TableColumn>
</TableHeader>
<TableBody>
<TableRow id="ada">
<TableCell>Ada Lovelace</TableCell>
<TableCell>Admin</TableCell>
</TableRow>
</TableBody>
</Table>