Type Alias: DataColumnConfig<TRow, TKey *extends* keyof `TRow` = keyof `TRow`>
type DataColumnConfig<TRow, TKey extends keyof TRow = keyof TRow> = ColumnPresentationConfig & {
badgeMap?: TRow[TKey] extends string | boolean ? TRow[TKey] extends boolean ? Partial<Record<"true" | "false", BadgeVariant>> : Partial<Record<TRow[TKey] & string, BadgeVariant>> : never;
emptyValue?: string;
exportValue?: (row: TRow) => string;
format?: ColumnFormat;
header?: string;
headerAriaLabel?: string;
hideable?: boolean;
href?: (row: TRow) => string;
key: TKey;
labelMap?: TRow[TKey] extends string | boolean ? TRow[TKey] extends boolean ? Record<"true" | "false", string> : Partial<Record<TRow[TKey] & string, string>> : never;
overflow?: ColumnOverflow;
rangeMaxKey?: keyof TRow;
render?: (value: TRow[TKey], row: TRow) => ReactNode;
sortable?: boolean;
textValue?: (value: TRow[TKey], row: TRow) => string;
truncate?: number;
};Defined in: shared/datatable/types.ts:85
Type Declaration
badgeMap?
optional badgeMap?: TRow[TKey] extends string | boolean ? TRow[TKey] extends boolean ? Partial<Record<"true" | "false", BadgeVariant>> : Partial<Record<TRow[TKey] & string, BadgeVariant>> : never;emptyValue?
optional emptyValue?: string;exportValue?
optional exportValue?: (row: TRow) => string;Override the exported (CSV/PDF) cell text for this column. Defaults to the
formatted display value; set this for columns whose render produces JSX
with no plain-text equivalent. Read only by exports, never by the table.
Parameters
| Parameter | Type |
|---|---|
row | TRow |
Returns
string
format?
optional format?: ColumnFormat;header?
optional header?: string;headerAriaLabel?
optional headerAriaLabel?: string;Screen-reader-only text for an intentionally blank visual header.
hideable?
optional hideable?: boolean;Whether the Columns control may hide this column. Defaults to true.
href?
optional href?: (row: TRow) => string;Parameters
| Parameter | Type |
|---|---|
row | TRow |
Returns
string
key
key: TKey;labelMap?
optional labelMap?: TRow[TKey] extends string | boolean ? TRow[TKey] extends boolean ? Record<"true" | "false", string> : Partial<Record<TRow[TKey] & string, string>> : never;overflow?
optional overflow?: ColumnOverflow;Override the automatic overflow policy for this column. Omit it: scalar text truncates on measured overflow, composite cells are left alone.
rangeMaxKey?
optional rangeMaxKey?: keyof TRow;render?
optional render?: (value: TRow[TKey], row: TRow) => ReactNode;Parameters
| Parameter | Type |
|---|---|
value | TRow[TKey] |
row | TRow |
Returns
ReactNode
sortable?
optional sortable?: boolean;textValue?
optional textValue?: (value: TRow[TKey], row: TRow) => string;The plain-text equivalent of this cell, used for the overflow tooltip.
Set it when render produces textual JSX that should truncate and expose
its full value — a ReactNode has no readable string form, so without
this the renderer is treated as composite and left untruncated.
Distinct from exportValue, which is row-level and read only by exports.
Parameters
| Parameter | Type |
|---|---|
value | TRow[TKey] |
row | TRow |
Returns
string
truncate?
optional truncate?: number;Deprecated
Scalar text now truncates automatically at the column's
resolved width, so a pixel cap is no longer needed — and this one is
ignored, not applied as a second max-width. Remove ordinary
declarations; use overflow for the exceptions and textValue for a
textual render.
Type Parameters
| Type Parameter | Default type |
|---|---|
TRow | - |
TKey extends keyof TRow | keyof TRow |