Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
Neon
WorkOS
Clerk
Convex
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
Neon
WorkOS
Clerk
Convex
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Table API Reference
Column API Reference
Row API Reference
Cell API Reference
Header API Reference
Features API Reference
Legacy API Reference
Enterprise
Column API Reference

createColumnHelper

Function: createColumnHelper()

ts
function createColumnHelper<TFeatures, TData>(): ColumnHelper<TFeatures, TData>;

Defined in: helpers/columnHelper.ts:94

A helper utility for creating column definitions with slightly better type inference for each individual column. The TValue generic is inferred based on the accessor key or function provided. Note: From a JavaScript perspective, the functions in these helpers do not do anything. They are only used to help TypeScript infer the correct types for the column definitions.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Returns

ColumnHelper<TFeatures, TData>

Example

tsx
const helper = createColumnHelper<typeof _features, Person>() // _features is the result of `tableFeatures({})` helper
const columns = [
 helper.display({ id: 'actions', header: 'Actions' }),
 helper.accessor('firstName', {}),
 helper.accessor((row) => row.lastName, {}
]