Skip to content

DataTableColumn

Defined in: src/components/data/DataTable/DataTable.types.ts:26

Description of a single column.

R is the row data type.

accessor may be a string (key of R) or a function returning the cell value. When omitted, id is used as a key into R if it matches a key, otherwise the cell is empty.

Type Parameters

R

R

Properties

accessor?

optional accessor: keyof R | (row, rowIndex) => unknown

Defined in: src/components/data/DataTable/DataTable.types.ts:32

How to read the cell value from a row.


align?

optional align: DataTableAlign

Defined in: src/components/data/DataTable/DataTable.types.ts:59

Cell horizontal alignment.

Default

"left"

ariaHidden?

optional ariaHidden: boolean

Defined in: src/components/data/DataTable/DataTable.types.ts:65

When false, the column header is not focusable for keyboard users.


cell()?

optional cell: (info) => ReactNode

Defined in: src/components/data/DataTable/DataTable.types.ts:38

Cell renderer. Receives the resolved value and the row. When omitted, the value is rendered with String(value) (or empty for null/undefined).

Parameters

info
column

DataTableColumn<R>

row

R

rowIndex

number

value

unknown

Returns

ReactNode


className?

optional className: string

Defined in: src/components/data/DataTable/DataTable.types.ts:61

Per-column className.


disableResize?

optional disableResize: boolean

Defined in: src/components/data/DataTable/DataTable.types.ts:67

When true, this column cannot be resized even if resizableColumns is on.


optional header: ReactNode

Defined in: src/components/data/DataTable/DataTable.types.ts:30

Header content (string or any node).


id

id: string

Defined in: src/components/data/DataTable/DataTable.types.ts:28

Stable column identifier. Required.


maxWidth?

optional maxWidth: number

Defined in: src/components/data/DataTable/DataTable.types.ts:49

Maximum column width in px (used for resizing).


minWidth?

optional minWidth: number

Defined in: src/components/data/DataTable/DataTable.types.ts:47

Minimum column width in px (used for resizing).


sortable?

optional sortable: boolean

Defined in: src/components/data/DataTable/DataTable.types.ts:51

When true, header click toggles sort on this column.


sortComparator()?

optional sortComparator: (a, b, rowA, rowB) => number

Defined in: src/components/data/DataTable/DataTable.types.ts:57

Custom comparator. Receives the resolved cell values for two rows. Default: localeCompare for strings, < for numbers, Date, null/undefined ordered last.

Parameters

a

unknown

b

unknown

rowA

R

rowB

R

Returns

number


sticky?

optional sticky: boolean

Defined in: src/components/data/DataTable/DataTable.types.ts:63

When true, this column sticks to the left edge while scrolling.


width?

optional width: string | number

Defined in: src/components/data/DataTable/DataTable.types.ts:45

Fixed column width (px or any CSS dimension).