Table

Use GdsTable for structured rows and columns of data. For simple vertical lists of actions or navigation, prefer List.

Composition

ComponentRole
GdsTableContainerWrapper that provides horizontal scrolling for wide tables. Pass component={GdsPaper} for a raised surface.
GdsTableThe main <table> element (size)
GdsTableHeadHeader row container (<thead>)
GdsTableBodyBody row container (<tbody>)
GdsTableFooterOptional footer row container (<tfoot>)
GdsTableRowA table row (<tr>) - use in head, body, or footer
GdsTableCellA cell (<th> in head, <td> in body by default)
GdsTableSortLabelSortable column header control
GdsTablePaginationPage and rows-per-page controls

Default

Compose the basic head / body structure. Use hover on body rows and scope="row" on the first cell of each data row.

Dense

Set size="small" for denser padding when space is tight or the table shows many rows.

Sorting

Wrap header labels in GdsTableSortLabel and keep order / orderBy in local state. Set sortDirection on the active GdsTableCell.

Selecting

Combine checkbox cells with selected on GdsTableRow. Selected backgrounds come from GDS table tokens.

Pagination

Place GdsTablePagination under the table (often as a sibling inside GdsTableContainer). Slice your data with page and rowsPerPage.

For standalone page controls outside a table, prefer Pagination (GdsPagination).

Accessibility

  • Give every table an aria-label (or associate a visible caption) that describes the data.
  • Use scope="row" on the leading cell of each body row when that cell identifies the row.
  • Label selection checkboxes with inputProps["aria-label"].
  • Keep sort state reflected with sortDirection / GdsTableSortLabel so assistive tech can announce the active column.

Props