Tablecraft

Installation

Required and optional peer dependencies for tablecraft, and which feature each optional peer unlocks.

Install

npm install @marvinackerman/tablecraft

Required peer dependencies

tablecraft's core entry (useTable, createColumns, and friends) is built on top of TanStack Table and needs React itself. Install these alongside it:

npm install @tanstack/react-table@"^9" react@">=18"
PackageRangeWhy
@tanstack/react-table^9tablecraft wraps its row model, column, and state APIs. TanStack Table v8 is no longer supported — see the v4 migration guide if you are upgrading from a v8-based tablecraft 3.x.
react>=18hooks-based, requires a React 18+ runtime

That is the whole list. Every other dependency is optional and confined to its own entry point — the root entry imports nothing else, so installing tablecraft never drags in a library you do not use.

Optional peer dependencies

These are only needed if you use the feature they back — install them as you reach for that feature, not up front:

PackageNeeded for
zod >=3.23.0The @marvinackerman/tablecraft/zod entry (columnsFromZod, zodValidator) — derive columns and row-edit validation from a single Zod schema. Works with Zod 3 and 4.
@tanstack/react-queryThe @marvinackerman/tablecraft/query entry (useQueryTable, useInfiniteTable) — server-driven and infinite-scroll tables backed by TanStack Query.
@tanstack/react-virtual >=3The @marvinackerman/tablecraft/virtual entry (useVirtualRows) — windowed rendering for large row counts.
match-sorterFuzzy search. The @marvinackerman/tablecraft/fuzzy entry (fuzzyFilterFn) works in every bundler; fuzzy: true on useTable reaches it through require() and so works in CJS/Node only.

Entry points

tablecraft publishes six entry points, so you only pull in the code paths you actually use:

EntryExports
@marvinackerman/tablecraftThe core hooks — useTable, createColumns, useInfiniteScroll, and friends. Importable with only the required peers above.
@marvinackerman/tablecraft/queryuseQueryTable, useInfiniteTable — requires the optional @tanstack/react-query peer.
@marvinackerman/tablecraft/virtualuseVirtualRows — requires the optional @tanstack/react-virtual peer.
@marvinackerman/tablecraft/fuzzyfuzzyFilterFn — typo-tolerant search that works in ESM bundlers. Requires the optional match-sorter peer.
@marvinackerman/tablecraft/zodcolumnsFromZod, zodValidator — requires the optional zod peer.
@marvinackerman/tablecraft/devtoolsTablecraftDevtools — inspect table state during development.
@marvinackerman/tablecraft/testingTest helpers, built against @testing-library/react.

On this page