<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@datashaper/react](./react.md) &gt; [useColumns](./react.usecolumns.md)

## useColumns() function

Overlays a number of special features onto the IColumn objects for a table. This includes overridden renderers to support our sorting, selection, and data visualization.

<b>Signature:</b>

```typescript
export declare function useColumns(table: ColumnTable, metadata?: TableMetadata, columns?: IColumn[], onColumnHeaderClick?: ColumnClickFunction, onSort?: ColumnClickFunction, options?: ColumnOptions, virtualColumns?: IColumn[]): IColumn[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  table | ColumnTable |  |
|  metadata | TableMetadata | <i>(Optional)</i> |
|  columns | IColumn\[\] | <i>(Optional)</i> |
|  onColumnHeaderClick | [ColumnClickFunction](./react.columnclickfunction.md) | <i>(Optional)</i> |
|  onSort | [ColumnClickFunction](./react.columnclickfunction.md) | <i>(Optional)</i> |
|  options | [ColumnOptions](./react.columnoptions.md) | <i>(Optional)</i> |
|  virtualColumns | IColumn\[\] | <i>(Optional)</i> |

<b>Returns:</b>

IColumn\[\]


