Features API
TanStack's Features API Reference lists the feature objects you register on a table, the built-in function registries, and the state types each feature owns. elm-table has no feature registry: every feature is compiled into the package and stays inert until its slice of State is non-empty or its stage is called. So each *Feature variable maps to a group of functions rather than to a value. This page maps TanStack's entries onto ours; full signatures and doc comments live on the generated Table module page and the three function modules.
Feature registry and core features
| TanStack | elm-table | Notes |
|---|---|---|
stockFeatures |
— | Nothing to register. Every feature is always available. |
coreFeatures |
— | Same reason. |
coreTablesFeature |
config, initialState |
See the Table API. |
coreColumnsFeature |
column, group, display and the column readers |
See the Column API. |
coreRowsFeature |
the row* readers and getValue |
See the Row API. |
coreRowModelsFeature |
rows and the six stage functions |
See Row Models. |
coreCellsFeature |
getAllCells, visibleCells |
See the Cell API. |
coreHeadersFeature |
headerGroups and the header* readers |
See the Header API. |
Cell spanning
| TanStack | elm-table | Notes |
|---|---|---|
cellSpanningFeature |
cellSpanIndex, cellRowSpan, cellColSpan, cellIsCovered, columnCanSpan |
Turned on with withCellSpanning; per column with withSpanRows, withSpanRowsWhen, withSpanColumns, withEnableCellSpanning. |
There is no state slice: spans are derived from the rows you render. The index is an explicit value, CellSpanIndex, because nothing is memoized. See Cell Spanning.
Column filtering
| TanStack | elm-table | Notes |
|---|---|---|
columnFilteringFeature |
filteredRowModel and the column-filter queries |
setColumnFilter, setColumnFilters, resetColumnFilters, getCanFilter, getIsFiltered, getFilterValue, getFilterIndex. |
ColumnFilter |
ColumnFilter |
{ id : String, value : Value }. TanStack's value is unknown. |
ColumnFiltersState |
State.columnFilters : List ColumnFilter |
Same list, same order. |
FilterFn |
FilterFn |
Carries filter, resolveFilterValue, resolveDataValue, and autoRemove, like TanStack's created filter fn. |
FilterFns |
— | No registry. A filter function is passed as a value with withFilterFn, or as a row predicate with withCustomFilter. |
FilterFnOption |
— | Same reason. No filter function set means auto; getAutoFilterFn picks it and getFilterFn resolves it. |
FilterMeta |
— | No per-row filter meta. Ranking a fuzzy match is the caller's job; see Fuzzy Filtering. |
BuiltInFilterFn |
the values of Table.FilterFn |
Names below. |
See Column Filtering.
Column faceting
| TanStack | elm-table | Notes |
|---|---|---|
columnFacetingFeature |
facetedRowModel, facetedUniqueValues, facetedMinMax, globalFacetKey |
No state slice. Facets are computed from the row model you pass in. |
See Faceting.
Row aggregation
| TanStack | elm-table | Notes |
|---|---|---|
rowAggregationFeature |
aggregationValue, aggregationValueOf, cellIsAggregated, rowAggregatedValues |
Values are computed by groupedRowModel and stored on the group row. |
AggregationFns |
— | No registry. Set one per column with withAggregationFn. |
AggregationFnOption |
— | Same reason. Unset means auto: getAutoAggregationFn picks sum for numbers and extent for dates, and getAggregationFn resolves it. TanStack's keyed list form, which produces an object of several results, has no counterpart. |
AggregationResult |
Value |
One Value per column, never a keyed object. |
AggregationContext |
— | An aggregation is List Value -> Value. It gets the values, not the table. |
AggregationValueContext |
— | Same reason. |
AggregationValueResult |
— | There is no "handled" marker, because there is no column-level value override to signal it from. |
AggregationMergeContext |
— | A merge is List Value -> Value over the child results; see withMerge. |
AggregationFnDef |
AggregationFn |
Opaque: a fold plus an optional merge. |
AggregationFnDescriptor |
— | Only needed to key entries of a multiple result, which has no counterpart. |
constructAggregationFn |
custom |
Add a merge with withMerge. |
BuiltInAggregationFn |
the values of Table.AggregationFn |
Names below. |
How far down an aggregation reads is withMaxAggregationDepth on the column. See Aggregation.
Column grouping
| TanStack | elm-table | Notes |
|---|---|---|
columnGroupingFeature |
groupedRowModel and the grouping queries |
toggleGrouping, setGrouping, resetGrouping, getCanGroup, getIsGrouped, getGroupedIndex, preGroupedRowModel. |
GroupingState |
State.grouping : List String |
Column ids, outermost first. |
GroupingColumnMode |
GroupedColumnMode |
The three variants are groupedColumnsReorder, groupedColumnsRemove, groupedColumnsIgnore. It is not in TanStack's nav list, but it is the type behind groupedColumnMode. |
See Grouping.
Column ordering
| TanStack | elm-table | Notes |
|---|---|---|
columnOrderingFeature |
setColumnOrder, resetColumnOrder, orderColumns, orderGroupedColumns, columnIndex, columnIsFirst, columnIsLast |
Ordering composes in one place, orderColumns. |
ColumnOrderState |
State.columnOrder : List String |
Column ids. Unlisted columns keep definition order behind the listed ones. |
See Column Ordering.
Column pinning
| TanStack | elm-table | Notes |
|---|---|---|
columnPinningFeature |
pinColumn, setColumnPinning, resetColumnPinning, columnCanPin, columnIsPinned, columnPinnedIndex, and the per-region column, header, and cell lists |
|
ColumnPinningState |
ColumnPinning |
{ left : List String, right : List String }. TanStack's fields are start and end. |
ColumnPinningPosition |
ColumnPinPosition |
pinnedLeft, pinnedRight, columnUnpinned replace 'start' | 'end' | false. |
Which slice a query is about is a ColumnRegion argument rather than an optional position, with allColumnsRegion standing for TanStack's absent argument. See Column Pinning.
Column resizing
| TanStack | elm-table | Notes |
|---|---|---|
columnResizingFeature |
— | No drag session. A resize is a pointer handler in your code that ends in setColumnSize; the committed width lives in State.columnSizing. |
columnResizingState |
— | Nothing to store between pointer events. Keep the drag start and delta in your own model. |
ColumnResizeMode |
— | You decide whether your handler writes on every move or only on release. |
ColumnResizeDirection |
— | No text-direction handling; the sign of the delta is yours. |
See Column Resizing.
Column sizing
| TanStack | elm-table | Notes |
|---|---|---|
columnSizingFeature |
getColumnSize, getColumnStart, getColumnAfter, getHeaderSize, getHeaderStart, totalSize, leftTotalSize, centerTotalSize, rightTotalSize, setColumnSize, setColumnSizing, resetColumnSize, resetColumnSizing |
|
ColumnSizingState |
State.columnSizing : Dict String Float |
Column id to committed width. |
Defaults are a SizeDefaults record set with withDefaultColumn, and per column with withSize, withMinSize, withMaxSize. See Column Sizing.
Column visibility
| TanStack | elm-table | Notes |
|---|---|---|
columnVisibilityFeature |
columnIsVisible, columnCanHide, toggleColumnVisibility, setColumnVisibility, resetColumnVisibility, toggleAllColumnsVisible, isAllColumnsVisible, isSomeColumnsVisible, visibleFlatColumns, visibleLeafColumns |
|
ColumnVisibilityState |
State.columnVisibility : Dict String Bool |
A column absent from the dict is visible. |
See Column Visibility.
Global filtering
| TanStack | elm-table | Notes |
|---|---|---|
globalFilteringFeature |
setGlobalFilter, resetGlobalFilter, getCanGlobalFilter, getGlobalFilterFn, globalAutoFilterFn |
The global filter runs inside filteredRowModel. |
The state slice is State.globalFilter : Value, and the function is set with withGlobalFilterFn. TanStack has no separate global-filter state type in this nav section. See Global Filtering.
Row expanding
| TanStack | elm-table | Notes |
|---|---|---|
rowExpandingFeature |
expandedRowModel and the expansion queries |
toggleExpanded, toggleAllRowsExpanded, setExpanded, resetExpanded, getCanExpand, getIsExpanded, getIsAllParentsExpanded, getExpandedDepth, preExpandedRowModel. |
ExpandedState |
Expanded |
expandAll is TanStack's true; expandedIds takes a Set String instead of a record of booleans, and expandedIdsOf reads it back. |
Per-row overrides are withRowCanExpand and withIsRowExpanded on the Config. See Expanding.
Row pagination
| TanStack | elm-table | Notes |
|---|---|---|
rowPaginationFeature |
paginatedRowModel and the page queries |
setPage, setPageSize, setPagination, firstPage, previousPage, nextPage, lastPage, getPageCount, getPageOptions, getRowCount, getCanPreviousPage, getCanNextPage, getCanLastPage, resetPageIndex, resetPageSize, resetPagination. |
PaginationState |
Pagination |
{ pageIndex : Int, pageSize : Int }. TanStack's Infinity page size is unlimitedPageSize. |
TanStack renames setPageIndex here to setPage. The counts read the pre-pagination model, prePaginationRowModel. See Pagination.
Row pinning
| TanStack | elm-table | Notes |
|---|---|---|
rowPinningFeature |
pinRow, pinRowWith, setRowPinning, resetRowPinning, getIsRowPinned, getRowPinnedIndex, getCanPinRow, isSomeRowsPinned, isSomeRowsPinnedTop, isSomeRowsPinnedBottom, topRows, bottomRows, centerRows |
|
RowPinningState |
RowPinning |
{ top : List String, bottom : List String }, the same shape. |
RowPinningPosition |
RowPinPosition |
pinnedTop, pinnedBottom, rowUnpinned. |
How much of a row's family is pinned along with it is a PinRowOptions record, with defaultPinRowOptions as the starting point. The pinned lists take a PinnedRowsSource, both the pre-pagination model and the page. See Row Pinning.
Row selection
| TanStack | elm-table | Notes |
|---|---|---|
rowSelectionFeature |
toggleRowSelected, toggleRowSelectedWith, toggleAllRowsSelected, toggleAllPageRowsSelected, deselectAllRows, setRowSelection, resetRowSelection, selectRange, selectRangeWith, canSelectRange, and the getIs* and getCan* queries |
|
RowSelectionState |
State.rowSelection : Set String |
TanStack's Record<string, true> is a set of row ids here. Read it with selectedRowIds or selectedRowModel. |
Sub-tree state is SubRowSelection with noSubRowsSelected, someSubRowsSelected, allSubRowsSelected, replacing TanStack's false | 'some' | 'all'. TanStack's ToggleSelectedOptions is SelectOptions, with defaultSelectOptions. The shift-click anchor is caller state, so selectRange takes the anchor row id. See Row Selection.
Row sorting
| TanStack | elm-table | Notes |
|---|---|---|
rowSortingFeature |
sortedRowModel and the sorting queries |
toggleSort, setSorting, clearSorting, resetSorting, getCanSort, getCanMultiSort, getIsSorted, getSortIndex, getNextSortingOrder. |
ColumnSort |
SortColumn |
{ id : String, desc : Bool }, the same shape under a different name. |
SortingState |
State.sorting : List SortColumn |
Same list, first entry sorted first. |
SortDirection |
SortDir |
sortAsc and sortDesc replace 'asc' and 'desc'. getIsSorted returns Maybe SortDir rather than false | 'asc' | 'desc'. |
SortFn |
SortFn |
A comparison on two Values, plus an optional resolveDataValue normaliser. |
SortFns |
— | No registry. Set one per column with withSortFn, or compare whole rows with withCustomSort. |
SortFnOption |
— | Same reason. Unset means auto: getAutoSortFn picks it and getSortFn resolves it. |
BuiltInSortFn |
the values of Table.SortFn |
Names below. |
Where Null values land is SortUndefined, with sortNullsFirst, sortNullsLast, sortNullsAsMinusOne, sortNullsAsPlusOne. See Sorting.
Cell selection
TanStack ships a cellSelectionFeature but does not list it in this nav section. It is here for completeness.
| TanStack | elm-table | Notes |
|---|---|---|
cellSelectionFeature |
selectCell, toggleCellSelection, selectCellRange, selectCellRangeWith, selectAllCells, setCellSelection, clearCellSelection, setFocusedCell, moveCellSelection, extendCellSelection, extendCellSelectionTo |
|
CellSelectionState |
State.cellSelection : List CellSelectionRange |
A list of rectangles, each built with cellRange. |
CellSelectionRange |
CellSelectionRange |
Two corners plus an operation. TanStack's optional operation is required here and defaults to includeCells. |
CellSelectionRangeOperation |
CellSelectionOperation |
includeCells, excludeCells. |
CellSelectionRangeMode |
CellSelectionMode |
replaceSelection, includeSelection, excludeSelection. |
CellSelectionDirection |
CellDirection |
cellUp, cellDown, cellLeft, cellRight. |
CellSelectionBounds |
CellSelectionBounds |
Inclusive display-order indexes. |
CellSelectionEdges |
CellSelectionEdges |
Which sides of a cell sit on the outer boundary. |
The cell queries are on the Cell API. The reads that resolve a selection take a SelectionRows.
Cell selection reads and geometry
Nothing in TanStack's nav list corresponds to these, so they are listed here.
| Value | What it does |
|---|---|
focusedCell |
The active cell, when there is one. |
selectedCellIds |
The ids of every selected cell. |
selectedCellCount |
How many cells are selected. |
selectedCellRangesData |
The values of each selected rectangle, row by row, ready for a clipboard copy. |
cellSelectionRowIds |
The row ids the selection touches. |
cellSelectionColumnIds |
The column ids the selection touches. |
cellSelectionColumnIndexes |
Column id to display-order index. |
cellSelectionBounds |
The selection resolved into rectangles of indexes. |
cellSelectionMergeBounds |
The same rectangles with spanning cells folded in. |
intersectCellSelectionBounds |
The overlap of two rectangles. |
subtractCellSelectionBounds |
One rectangle minus another, as a list. |
addCellSelectionBounds |
Add a rectangle to a list without overlapping the others. |
mergeAdjacentCellSelectionBounds |
Join touching rectangles. |
expandCellSelectionBounds |
Grow a rectangle until it covers every span it clips. |
applyCellSelectionBoundsOperations |
Fold a list of include and exclude rectangles into the final positive area. |
spanAllColumns |
The span value that means "to the end of the region". |
cellSpanIndexRowIds |
The row ids a span index was built over. |
cellSpanIndexRowSpans |
The row spans of a span index, keyed by column id. |
See Cell Selection.
Built-in sort functions
TanStack's sortFns object. Every name has the same name here, as a value of Table.SortFn. Nothing is missing in either direction.
TanStack sortFns |
elm-table |
|---|---|
alphanumeric |
SortFn.alphanumeric |
alphanumericCaseSensitive |
SortFn.alphanumericCaseSensitive |
basic |
SortFn.basic |
datetime |
SortFn.datetime |
text |
SortFn.text |
textCaseSensitive |
SortFn.textCaseSensitive |
The module also exposes what TanStack keeps outside the registry: custom for constructSortFn, withResolveDataValue for overriding a built-in's normaliser, compare and resolveDataValue for applying one, and splitAlphaNumeric, which is TanStack's reSplitAlphaNumeric.
Built-in filter functions
TanStack's filterFns object. Every name has the same name here, as a value of Table.FilterFn.
TanStack filterFns |
elm-table |
|---|---|
arrIncludes |
FilterFn.arrIncludes |
arrIncludesAll |
FilterFn.arrIncludesAll |
arrHas |
FilterFn.arrHas |
arrIncludesSome |
FilterFn.arrIncludesSome |
between |
FilterFn.between |
betweenInclusive |
FilterFn.betweenInclusive |
empty |
FilterFn.empty |
endsWith |
FilterFn.endsWith |
equals |
FilterFn.equals |
equalsString |
FilterFn.equalsString |
equalsStringSensitive |
FilterFn.equalsStringSensitive |
inDateRange |
FilterFn.inDateRange |
inNumberRange |
FilterFn.inNumberRange |
includesString |
FilterFn.includesString |
includesStringSensitive |
FilterFn.includesStringSensitive |
notEmpty |
FilterFn.notEmpty |
startsWith |
FilterFn.startsWith |
weakEquals |
FilterFn.weakEquals |
Four more filter functions are exported by TanStack but left out of its filterFns object, so they are not part of BuiltInFilterFn. All four exist here as ordinary values.
| TanStack export | elm-table |
|---|---|
filterFn_greaterThan |
FilterFn.greaterThan |
filterFn_greaterThanOrEqualTo |
FilterFn.greaterThanOrEqualTo |
filterFn_lessThan |
FilterFn.lessThan |
filterFn_lessThanOrEqualTo |
FilterFn.lessThanOrEqualTo |
The rest of the module matches TanStack's constructFilterFn and the four parts every filter function carries: custom, withResolveFilterValue, withResolveDataValue, withAutoRemove, and the appliers filter, resolveFilterValue, resolveDataValue, autoRemove, plus toDateTimestamp.
There is no fuzzy filter in either package. TanStack's fuzzy example builds one with an external ranking library; see Fuzzy Filtering.
Built-in aggregation functions
TanStack's aggregationFns object. Every name has the same name here, as a value of Table.AggregationFn. Nothing is missing in either direction.
TanStack aggregationFns |
elm-table |
|---|---|
sum |
AggregationFn.sum |
min |
AggregationFn.min |
max |
AggregationFn.max |
extent |
AggregationFn.extent |
mean |
AggregationFn.mean |
median |
AggregationFn.median |
unique |
AggregationFn.unique |
uniqueCount |
AggregationFn.uniqueCount |
count |
AggregationFn.count |
first |
AggregationFn.first |
last |
AggregationFn.last |
Building and applying one: custom, withMerge, aggregate, merge.