API Reference
@domphy/table is a 1-1 port of @tanstack/table-core v8.21.3 — every export below has identical behavior to upstream, so the TanStack Table v8 reference documents each item in full detail.
Core
createTable(options)— builds the table instance. Key options:data,columns,state,onStateChange,initialState, theget*RowModelfactories,getRowId,getSubRows,renderFallbackValue, plus per-featureenable*/manual*flagscreateColumnHelper<TData>()— typed column def builder:accessor(by key or function),display,group
Row Models
All opt-in factories passed into createTable options; only the first is required:
getCoreRowModel()— base rows fromdatagetSortedRowModel()— sortinggetFilteredRowModel()— column filters + global filtergetPaginationRowModel()— page slicinggetGroupedRowModel()— grouping and aggregationgetExpandedRowModel()— expanding and sub-rowsgetFacetedRowModel()— per-column faceting basegetFacetedUniqueValues()—Map<value, count>per columngetFacetedMinMaxValues()—[min, max]per column
Built-In Functions
sortingFns—alphanumeric,alphanumericCaseSensitive,text,textCaseSensitive,datetime,basicfilterFns—includesString,includesStringSensitive,equalsString,equals,weakEquals,arrIncludes,arrIncludesAll,arrIncludesSome,inNumberRangeaggregationFns—sum,min,max,extent,mean,median,unique,uniqueCount,count
Instance APIs Per Feature
Each feature contributes methods to the table, column, row, and header objects. Summarized; see the feature pages for usage:
- Sorting —
table.setSorting/resetSorting;column.toggleSorting,getIsSorted,getCanSort,clearSorting,getToggleSortingHandler - Column filtering —
table.setColumnFilters;column.setFilterValue,getFilterValue,getIsFiltered,getCanFilter - Global filtering —
table.setGlobalFilter,resetGlobalFilter,getGlobalFilterFn(rows come out ofgetFilteredRowModel) - Pagination —
table.setPageIndex,setPageSize,nextPage,previousPage,firstPage,lastPage,getPageCount,getCanNextPage,getCanPreviousPage - Row selection —
table.toggleAllRowsSelected,toggleAllPageRowsSelected,getIsAllRowsSelected,getSelectedRowModel,resetRowSelection;row.toggleSelected,getIsSelected,getCanSelect - Grouping —
table.setGrouping,resetGrouping;column.toggleGrouping,getIsGrouped;cell.getIsGrouped,getIsAggregated,getIsPlaceholder - Expanding —
table.setExpanded,toggleAllRowsExpanded;row.toggleExpanded,getIsExpanded,getCanExpand,getToggleExpandedHandler - Visibility —
table.setColumnVisibility,toggleAllColumnsVisible,getVisibleLeafColumns;column.toggleVisibility,getIsVisible,getCanHide - Ordering —
table.setColumnOrder,resetColumnOrder - Column pinning —
table.setColumnPinning,getLeftLeafColumns/center/right (plus header-group and visible-cell variants);column.pin,getIsPinned,getStart,getAfter - Row pinning —
table.setRowPinning,getTopRows,getBottomRows;row.pin,getIsPinned - Sizing —
table.setColumnSizing,resetColumnSizing;column.getSize,getIsResizing;header.getSize,getResizeHandler - Faceting —
column.getFacetedRowModel,getFacetedUniqueValues,getFacetedMinMaxValues; global variants ontable
Utilities
functionalUpdate(updater, input)— resolve anUpdater<T>(value or function) against the current valuemakeStateUpdater(key, instance)— build a per-keyonChangehandler that writes throughonStateChangememo(getDeps, fn, options)— the dependency-memoization primitive all row models useflattenBy(array, getChildren),isFunction,isNumberArray,noopreSplitAlphaNumeric— the regex behindalphanumericsorting
Types
All public types are re-exported, including:
- instance shapes:
Table,Column,Row,Cell,Header,HeaderGroup,RowModel,RowData - options & state:
TableOptions,TableState,InitialTableState,Updater - column defs:
ColumnDef,AccessorKeyColumnDef,AccessorFnColumnDef,DisplayColumnDef,GroupColumnDef,IdentifiedColumnDef,ColumnHelper,CellContext,HeaderContext - feature state:
SortingState,ColumnFiltersState,GlobalFilterState(viaTableState),PaginationState,RowSelectionState,GroupingState,ExpandedState,VisibilityState,ColumnOrderState,ColumnPinningState,RowPinningState,ColumnSizingState,ColumnSizingInfoState - functions:
SortingFn,FilterFn,AggregationFn,AccessorFn, plusBuiltInSortingFn,BuiltInFilterFn,BuiltInAggregationFn
CDN Global
The IIFE bundle exposes everything under Domphy.table: