Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
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
Static Functions API Reference
Legacy API Reference
Column API Reference

createColumnHelper

Function: createColumnHelper()

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

Defined in: helpers/columnHelper.ts:99

Creates helper functions for authoring column definitions with stronger value inference.

accessor infers TValue from an accessor key or accessor function, display creates non-data columns, group creates parent columns, and columns preserves tuple-level value types for arrays. At runtime these helpers only return column definition objects.

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, { id: 'lastName' }),
]
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, { id: 'lastName' }),
]