Row API
TanStack's Row API Reference covers the row object, the row-model factories you register on a table, and the caches that hold their results. elm-table has the same six stages, but each one is a plain function from a row model to a row model, called in order and never cached. This page maps TanStack's entries onto ours; full signatures and doc comments live on the generated Table module page. For prose, see Row Models and Rows.
Types#
| TanStack |
elm-table |
Notes |
Row |
Row |
Opaque. Read it with the row* functions below. |
RowData |
the row type variable |
Every function is Table.Row row for your own record type. No constraint on it. |
RowModel |
RowModel |
A plain record: rows, flatRows, rowsById. Every stage takes one and returns one. |
constructRow |
— |
Rows are built by coreRowModel. There is no single-row constructor. |
Row-model factories#
TanStack's create*RowModel functions return a factory that a table calls when a slice of state changes. Ours are the stage functions themselves: you call them in order, or call rows to run the whole chain. Each stage is skipped by its manual flag on the Config.
| TanStack |
elm-table |
Notes |
createCoreRowModel |
coreRowModel |
One row per datum, sub-rows resolved, ids assigned. coreRowModelFromList is the List form. |
createFilteredRowModel |
filteredRowModel |
Drops the rows that fail the column filters and the global filter. |
createSortedRowModel |
sortedRowModel |
Sorts every level of the row tree. |
createGroupedRowModel |
groupedRowModel |
Replaces the rows with group rows. |
createExpandedRowModel |
expandedRowModel |
Flattens the expanded branches into the row list. |
createPaginatedRowModel |
paginatedRowModel |
Keeps only the rows of the current page. |
createFacetedRowModel |
facetedRowModel |
The rows one column's facets are computed from: every active filter applied except that column's own. |
createFacetedMinMaxValues |
facetedMinMax |
The smallest and largest numeric value of one column. |
createFacetedUniqueValues |
facetedUniqueValues |
Every distinct value of one column with the number of rows that carry it. |
expandRows |
expandedRowModel |
TanStack exports the flattening helper separately; here it is only the stage. rowsInDisplayOrder does the same job for the rendered page when paginateExpandedRows is off. |
RowModelFns |
— |
No fn registry. A sort or filter function is passed as a value, not looked up by name. |
CreateRowModels |
— |
No registration step. Call the stages you want. |
CachedRowModels |
— |
No cache. Recompute on each update, or keep the row model in your own model if you would rather not. |
The pipeline order is core, filtered, grouped, sorted, expanded, paginated. That matches TanStack, where preSorted is the grouped row model.
The pipeline#
Faceting#
Reading one row#
These take a Row alone.
Reading a row against a config or a row model#
The per-feature row queries and transitions (selection, pinning, expansion, pagination) are on the Features API page.