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@"^8" react@">=18"
PackageRangeWhy
@tanstack/react-table^8tablecraft wraps its row model, column, and state APIs. TanStack Table v9 renamed these (getCoreRowModelcreateCoreRowModel) and is not supported.
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 (fuzzy: true on useTable). Loaded via require(), so this only applies in CJS/Node bundlers — in ESM-only bundlers (e.g. Vite), pass your own filter function instead and skip this dependency entirely.

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/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