Repository navigation
v0.5.0
0.5.0 is the last round of breaking changes before the API settles. Every change, with what to do, is in MIGRATION.md.
New
- Multi-column sort, opt-in with
useTableSort({ multiSort: true }). Shift+click a header to add it as the next sort key, or press Shift+Enter or Shift+Space on a focused header. While two or more columns are sorted, each header shows its place, and screen readers hear it ("sort priority 2, descending"). - Row expansion with a real button.
renderExpandedRowadds a leading expand column with a disclosure button per row. It works by keyboard and screen reader, witharia-expandedandaria-controls. The table keeps the open rows itself, or you hold them withuseTableExpansion.expandOnRowClicktoggles a row from a click anywhere on it. - One persistence scheme. Give the table and its hooks the same
persistKey.- URL params are namespaced (
members.sort=name,-team&members.page=3), so two persisted tables can share a page, and a copied link reproduces the view it came from. - Storage keys are versioned (
rdt:1:members:sort). - Restoring never causes a hydration mismatch, and every hook returns
isRestored.
- URL params are namespaced (
- Pagination without a total, for cursor APIs. Leave
totalCountout, and the footer shows the page's range while Next followshasNextPage. - Every accessible name is translatable.
labelsnow covers every string the table announces, and each row menu is named after its row.
Breaking
TableColumn.idis required, andgetColumnIdis gone.sortis{ sortBy, onSort }, anduseTableSortreturns it as it is.useTableSelectionreturns theselectionprop as it is.usePagination,useCursorPaginationandusePersistedFilterstake or return options objects.renderExpandedRowreturns content only.- Persistence keys and URL params changed, and 0.4 saved state is ignored.
- Several renames and removals:
callbackActionis nowonSelect.- The column
classNameis nowheaderClassName, and itsrowClassNameis nowcellClassName. PaginationClientis nowPagination.pageandofare nowpageOf.--drag-selectionis now--rdt-drag-selection.SortOrderand uppercase sort directions are gone.
See MIGRATION.md for the full list.
Fixed
- Choosing a plain action-menu item with Enter or Space closed the menu without running it.
- Clicks on a row's controls (its checkbox, links, buttons) also fired
onRowClick. - Without an action menu, each row's last cell spanned two columns. With an action menu, the empty and expanded rows counted one column too many.
- Checkbox ids repeated across tables, and a page element with the same id as a column could take over that column's label in the panel.