# applyColumnDefaults

> _Since v1.5.0_

Apply column defaults to a list of columns. Individual column properties
override defaults — the per-column value always wins over the default.

```ts
applyColumnDefaults(columns: ColumnConfig<TRow>[], defaults: Partial<ColumnConfig<TRow>> | undefined): ColumnConfig<TRow>[]
```

## Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `columns` | <code><a href="/grid/react/api/types/columnconfig/">ColumnConfig</a>&lt;TRow&gt;[]</code> | Normalized columns to merge defaults into |
| `defaults` | <code>Partial&lt;<a href="/grid/react/api/types/columnconfig/">ColumnConfig</a>&lt;TRow&gt;&gt; &#124; undefined</code> | Partial column config applied as a baseline; pass `undefined` to no-op |

## Returns

`ColumnConfig<TRow>[]` - A new array with the defaults merged in (input is not mutated)

#### Example

```tsx
applyColumnDefaults(
  [{ field: 'id' }, { field: 'name', sortable: false }],
  { sortable: true, resizable: true },
);
// [
//   { field: 'id',   sortable: true,  resizable: true },
//   { field: 'name', sortable: false, resizable: true },
// ]
```
