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
Section titled “Type Parameters”R
Properties
Section titled “Properties”accessor?
Section titled “accessor?”
optionalaccessor?: keyofR| ((row,rowIndex) =>unknown)
Defined in: src/components/data/DataTable/DataTable.types.ts:32
How to read the cell value from a row.
align?
Section titled “align?”
optionalalign?:DataTableAlign
Defined in: src/components/data/DataTable/DataTable.types.ts:59
Cell horizontal alignment.
Default
Section titled “Default”"left"ariaHidden?
Section titled “ariaHidden?”
optionalariaHidden?:boolean
Defined in: src/components/data/DataTable/DataTable.types.ts:65
When false, the column header is not focusable for keyboard users.
optionalcell?: (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
Section titled “Parameters”column
Section titled “column”DataTableColumn<R>
R
rowIndex
Section titled “rowIndex”number
unknown
Returns
Section titled “Returns”ReactNode
className?
Section titled “className?”
optionalclassName?:string
Defined in: src/components/data/DataTable/DataTable.types.ts:61
Per-column className.
disableResize?
Section titled “disableResize?”
optionaldisableResize?:boolean
Defined in: src/components/data/DataTable/DataTable.types.ts:67
When true, this column cannot be resized even if resizableColumns is on.
header?
Section titled “header?”
optionalheader?:ReactNode
Defined in: src/components/data/DataTable/DataTable.types.ts:30
Header content (string or any node).
id:
string
Defined in: src/components/data/DataTable/DataTable.types.ts:28
Stable column identifier. Required.
maxWidth?
Section titled “maxWidth?”
optionalmaxWidth?:number
Defined in: src/components/data/DataTable/DataTable.types.ts:49
Maximum column width in px (used for resizing).
minWidth?
Section titled “minWidth?”
optionalminWidth?:number
Defined in: src/components/data/DataTable/DataTable.types.ts:47
Minimum column width in px (used for resizing).
sortable?
Section titled “sortable?”
optionalsortable?:boolean
Defined in: src/components/data/DataTable/DataTable.types.ts:51
When true, header click toggles sort on this column.
sortComparator?
Section titled “sortComparator?”
optionalsortComparator?: (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
Section titled “Parameters”unknown
unknown
R
R
Returns
Section titled “Returns”number
sticky?
Section titled “sticky?”
optionalsticky?:boolean
Defined in: src/components/data/DataTable/DataTable.types.ts:63
When true, this column sticks to the left edge while scrolling.
width?
Section titled “width?”
optionalwidth?:string|number
Defined in: src/components/data/DataTable/DataTable.types.ts:45
Fixed column width (px or any CSS dimension).