Tablecraft
API Reference

TableKitProvider

Set app-level defaults for all tablecraft hooks — per-call options always override provider defaults.

Set defaults for all tables in your app. Per-call options always override provider defaults.

TableKitProvider

function TableKitProvider(props: TableKitProviderProps): JSX.Element

TableKitProviderProps

PropTypeDescription
defaultsTableKitDefaultsDefault options applied to all useTable / useQueryTable calls within this provider
childrenReactNode

TableKitDefaults

PropertyTypeDescription
pageSizenumberDefault page size for all tables
fuzzybooleanEnable fuzzy search by default
rowSelectionRowSelectionOptions | booleanEnable row selection by default
columnVisibilityColumnVisibilityOptions | booleanEnable column visibility by default
globalFilterbooleanEnable global filter by default
columnFiltersbooleanEnable column filters by default
persistPersistStorage | falseDefault persistence strategy
persistOptionsPersistOptionsDefault persist options
syncUrlboolean | URLSyncOptionsDefault URL sync
rowExpansionRowExpansionOptions | booleanEnable row expansion by default
groupingGroupingOptions | booleanEnable row grouping by default
columnPinningColumnPinningOptions | booleanEnable column pinning by default
import { TableKitProvider } from '@marvinackerman/tablecraft'

function App() {
  return (
    <TableKitProvider
      defaults={{
        pageSize: 25,
        globalFilter: true,
        persist: 'localStorage',
      }}
    >
      <YourApp />
    </TableKitProvider>
  )
}

useTableKitDefaults

Read the current TableKitProvider defaults. Returns an empty object if no provider is present — safe to call without a provider.

function useTableKitDefaults(): TableKitDefaults
import { useTableKitDefaults } from '@marvinackerman/tablecraft'

const defaults = useTableKitDefaults()

On this page