# PivotTableState (@salmonui/pivot-table)

> The PivotTableState interface of @salmonui/pivot-table: Serializable state (api.getState()).

Canonical: https://salmonui.dev/docs/reference/pivot-table/PivotTableState

```ts
import type { PivotTableState } from '@salmonui/pivot-table';
```

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

## Reference

Kind: interface

```ts
interface PivotTableState {
    readonly version: 1;
    readonly pivotModel: PivotModel;
    readonly layout?: 'compact' | 'tabular' | undefined;
    readonly columnWidths?: Readonly<Record<string, number>> | undefined;
}
```

Serializable state (`api.getState()`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: 1;` |  | Schema version; `restoreState()` rejects newer versions. |
| `pivotModel` | `readonly pivotModel: PivotModel;` |  |  |
| `layout` | `readonly layout?: 'compact' \| 'tabular' \| undefined;` | optional |  |
| `columnWidths` | `readonly columnWidths?: Readonly<Record<string, number>> \| undefined;` | optional | User column widths by column key. |
