# DataGridColumnInfo (@salmonui/data-grid)

> The DataGridColumnInfo interface of @salmonui/data-grid: Read-only public view of a compiled column, as render props and events receive it. Field names follow the name table; flags carry their resolved defaults. Values are the definition's (runtime visibility, width, order, and pin state are in api.getState() and the column events).

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridColumnInfo

```ts
import type { DataGridColumnInfo } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
interface DataGridColumnInfo<Row = unknown> {
    readonly id: string;
    readonly field: string | null;
    readonly header: string;
    readonly type: ColumnType;
    readonly format: string | FormatOptions | undefined;
    readonly align: 'start' | 'center' | 'end' | 'justify' | undefined;
    readonly headerAlign: 'start' | 'center' | 'end' | undefined;
    readonly width: ColumnWidth;
    readonly minWidth: number;
    readonly maxWidth: number;
    readonly pinned: 'start' | 'end' | 'center' | null;
    readonly hidden: boolean;
    readonly sortable: boolean;
    readonly filterable: boolean;
    readonly searchable: boolean;
    readonly groupable: boolean;
    readonly editable: boolean;
    readonly resizable: boolean;
    readonly reorderable: boolean;
    readonly hideable: boolean;
    readonly primaryKey: boolean;
    readonly lockPosition: boolean;
    readonly displayAsCheckbox: boolean;
    readonly leaf: boolean;
    readonly depth: number;
    readonly path: readonly string[];
    readonly children: readonly string[];
    readonly definition: Readonly<Record<string, unknown>>;
    getValue(row: Row): unknown;
    formatValue(value: unknown, row: Row): string;
}
```

Read-only public view of a compiled column, as render props and events
receive it. Field names follow the name table; flags carry their resolved
defaults. Values are the definition's (runtime visibility, width, order,
and pin state are in `api.getState()` and the column events).

Members (30):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  | The column key: `id`, else `field`, else a generated id. Payloads call it `field`. |
| `field` | `readonly field: string \| null;` |  | The data field (dot path), or null for columns without one. |
| `header` | `readonly header: string;` |  |  |
| `type` | `readonly type: ColumnType;` |  |  |
| `format` | `readonly format: string \| FormatOptions \| undefined;` |  |  |
| `align` | `readonly align: 'start' \| 'center' \| 'end' \| 'justify' \| undefined;` |  |  |
| `headerAlign` | `readonly headerAlign: 'start' \| 'center' \| 'end' \| undefined;` |  |  |
| `width` | `readonly width: ColumnWidth;` |  |  |
| `minWidth` | `readonly minWidth: number;` |  |  |
| `maxWidth` | `readonly maxWidth: number;` |  | `Infinity` when unbounded. |
| `pinned` | `readonly pinned: 'start' \| 'end' \| 'center' \| null;` |  | Definition pin side. |
| `hidden` | `readonly hidden: boolean;` |  | Definition visibility. |
| `sortable` | `readonly sortable: boolean;` |  |  |
| `filterable` | `readonly filterable: boolean;` |  |  |
| `searchable` | `readonly searchable: boolean;` |  |  |
| `groupable` | `readonly groupable: boolean;` |  |  |
| `editable` | `readonly editable: boolean;` |  |  |
| `resizable` | `readonly resizable: boolean;` |  |  |
| `reorderable` | `readonly reorderable: boolean;` |  |  |
| `hideable` | `readonly hideable: boolean;` |  | Listed in the column chooser. |
| `primaryKey` | `readonly primaryKey: boolean;` |  |  |
| `lockPosition` | `readonly lockPosition: boolean;` |  |  |
| `displayAsCheckbox` | `readonly displayAsCheckbox: boolean;` |  |  |
| `leaf` | `readonly leaf: boolean;` |  | False for stacked header groups. |
| `depth` | `readonly depth: number;` |  | Header depth (0 for top level). |
| `path` | `readonly path: readonly string[];` |  | Stacked header group ids, root first, ending with this column. |
| `children` | `readonly children: readonly string[];` |  | Child column ids of a stacked header group. |
| `definition` | `readonly definition: Readonly<Record<string, unknown>>;` |  | The column definition as given (`columns` entry or `<DataGridColumn>` props). |
| `getValue` | `getValue(row: Row): unknown;` |  | The column value of a row (`valueGetter`, else `field`). |
| `formatValue` | `formatValue(value: unknown, row: Row): string;` |  | The display text of a value (`valueFormatter`, else `format`). |
