# PivotTableProps (@salmonui/pivot-table)

> The PivotTableProps interface of @salmonui/pivot-table.

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

```ts
import type { PivotTableProps } 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 PivotTableProps<Row = unknown> extends UsePivotOptions<Row>, PivotDisplayProps {
    pivot?: PivotController<Row> | undefined;
    layout?: PivotTableLayout | undefined;
    fieldList?: boolean | 'popup' | undefined;
    axisBar?: boolean | PivotAxisBarOptions | undefined;
    toolbar?: readonly (PivotToolbarItemId | PivotToolbarItem)[] | undefined;
    drillThrough?: boolean | {
        readonly maxRows?: number;
    } | undefined;
    valueSorting?: boolean | {
        readonly multipleAxis?: boolean;
    } | undefined;
    editing?: boolean | DataGridEditing<Row> | undefined;
    paging?: boolean | {
        readonly rows?: number;
        readonly columns?: number;
    } | undefined;
    aggregateOptions?: readonly PivotAggregate[] | undefined;
    selection?: boolean | {
        readonly multiple?: boolean;
    } | undefined;
    emptyCellText?: string | undefined;
    renderCell?: ((ctx: PivotCellContext) => ReactNode) | undefined;
    renderHeader?: ((ctx: PivotHeaderContext) => ReactNode) | undefined;
    renderTooltip?: ((ctx: PivotTooltipContext) => ReactNode) | undefined;
    renderLoading?: ((ctx: PivotLoadingContext) => ReactNode) | undefined;
    getCellClassName?: ((ctx: PivotCellContext) => string | undefined) | undefined;
    onCellClick?: ((event: PivotCellClickEvent) => void) | undefined;
    persistState?: PivotPersistState | undefined;
    exportWriters?: PivotExportWriters | undefined;
    localeText?: PivotLocaleText | undefined;
    id?: string | undefined;
    className?: string | undefined;
    style?: CSSProperties | undefined;
    'aria-label'?: string | undefined;
    ref?: Ref<PivotTableApi<Row>> | undefined;
}
```

Members (71):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `pivot?: PivotController<Row> \| undefined;` | optional | A shared store from `usePivot()`; without it the table creates its own from `data`, `fields`, `pivotModel`. |
| `layout` | `layout?: PivotTableLayout \| undefined;` | optional | `compact` (default): row members as a tree in one column (`treegrid`); `tabular`: one pinned column per row field. |
| `fieldList` | `fieldList?: boolean \| 'popup' \| undefined;` | optional | Built-in field list: `'popup'` (or `true`) opens it from the toolbar and `api.openFieldList()`. |
| `axisBar` | `axisBar?: boolean \| PivotAxisBarOptions \| undefined;` | optional | Built-in axis bar above the table. |
| `toolbar` | `toolbar?: readonly (PivotToolbarItemId \| PivotToolbarItem)[] \| undefined;` | optional | Built-in toolbar items above the table. |
| `drillThrough` | `drillThrough?: boolean \| {     readonly maxRows?: number; } \| undefined;` | optional | Double-click or Enter on a value cell opens its raw rows. |
| `valueSorting` | `valueSorting?: boolean \| {     readonly multipleAxis?: boolean; } \| undefined;` | optional | Value sort buttons on the leaf column headers: a click or Enter / Space on the header cycles ascending, descending, none (Shift+Enter on a header that also drills). `multipleAxis` (default true) sorts every row level. |
| `editing` | `editing?: boolean \| DataGridEditing<Row> \| undefined;` | optional | Editing of the drill-through grid; edits write through and re-aggregate. |
| `paging` | `paging?: boolean \| {     readonly rows?: number;     readonly columns?: number; } \| undefined;` | optional | Paging instead of virtualization (opt-in): page sizes for rows and columns. `true` (or `{}`) uses the defaults, 10 rows and 5 column members per page; an object pages only the axes it names. |
| `aggregateOptions` | `aggregateOptions?: readonly PivotAggregate[] \| undefined;` | optional | Aggregates offered by the value field menus. |
| `selection` | `selection?: boolean \| {     readonly multiple?: boolean; } \| undefined;` | optional | Cell selection. Default off. |
| `emptyCellText` | `emptyCellText?: string \| undefined;` | optional | Text of empty value cells. Default ''. |
| `renderCell` | `renderCell?: ((ctx: PivotCellContext) => ReactNode) \| undefined;` | optional |  |
| `renderHeader` | `renderHeader?: ((ctx: PivotHeaderContext) => ReactNode) \| undefined;` | optional |  |
| `renderTooltip` | `renderTooltip?: ((ctx: PivotTooltipContext) => ReactNode) \| undefined;` | optional |  |
| `renderLoading` | `renderLoading?: ((ctx: PivotLoadingContext) => ReactNode) \| undefined;` | optional |  |
| `getCellClassName` | `getCellClassName?: ((ctx: PivotCellContext) => string \| undefined) \| undefined;` | optional |  |
| `onCellClick` | `onCellClick?: ((event: PivotCellClickEvent) => void) \| undefined;` | optional |  |
| `persistState` | `persistState?: PivotPersistState \| undefined;` | optional | Saves the model in storage and restores it on mount. |
| `exportWriters` | `exportWriters?: PivotExportWriters \| undefined;` | optional | Export writer loader: a dynamic import of the `pivot` subpath of the |
| `localeText` | `localeText?: PivotLocaleText \| undefined;` | optional |  |
| `id` | `id?: string \| undefined;` | optional |  |
| `className` | `className?: string \| undefined;` | optional |  |
| `style` | `style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `'aria-label'?: string \| undefined;` | optional |  |
| `ref` | `ref?: Ref<PivotTableApi<Row>> \| undefined;` | optional |  |
| `onBeforePivotModelChange` | `onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onPivotModelChange` | `onPivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onBeforeExpandedChange` | `onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onExpandedChange` | `onExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFilterChange` | `onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onFilterChange` | `onFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onBeforeSortChange` | `onBeforeSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onSortChange` | `onSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFieldMove` | `onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onFieldMove` | `onFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onBeforeMemberEditorOpen` | `onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void);` | optional, inherited |  |
| `onBeforeAggregateMenuOpen` | `onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void);` | optional, inherited |  |
| `onBeforeCalculatedFieldChange` | `onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onCalculatedFieldChange` | `onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onBeforeDrillThrough` | `onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onDrillThrough` | `onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onBeforeSelectionChange` | `onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onSelectionChange` | `onSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onDataChange` | `onDataChange?: ((event: PivotDataChangeEvent<Row>) => void);` | optional, inherited |  |
| `onComputeStart` | `onComputeStart?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onComputeEnd` | `onComputeEnd?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onBeforeExport` | `onBeforeExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onExport` | `onExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onError` | `onError?: ((event: PivotErrorEvent) => void);` | optional, inherited |  |
| `data` | `data?: readonly Row[];` | optional, inherited | Raw rows by reference. Reactive: a new array re-aggregates (incrementally for small deltas). |
| `fields` | `fields?: readonly PivotFieldDefinition<Row>[];` | optional, inherited | Field definitions; inferred from the first rows when omitted. Read on creation. |
| `pivotModel` | `pivotModel?: PivotModelInput;` | optional, inherited | Reactive report model: re-applied when it changes structurally, never reset by an equal fresh literal. |
| `defaultPivotModel` | `defaultPivotModel?: PivotModelInput;` | optional, inherited | Initial report model (uncontrolled). |
| `locale` | `locale?: string;` | optional, inherited |  |
| `customAggregates` | `customAggregates?: Readonly<Record<string, PivotCustomAggregator<unknown>>>;` | optional, inherited |  |
| `getCellValue` | `getCellValue?: ((cell: PivotCell) => number \| null);` | optional, inherited | Pure value override per cell. |
| `worker` | `worker?: PivotWorkerLike;` | optional, inherited | Runs the engine in this Worker (`new Worker(new URL('@salmonui/pivot-table/engine/worker', import.meta.url), { type: 'module' })`). Read on creation. The server renders the loading state. |
| `deferComputeAbove` | `deferComputeAbove?: number;` | optional, inherited | Rows above which the first compute is deferred to the client after the first paint (the server renders the header and a loading state, `aria-busy`). Default 50,000. |
| `createEngine` | `createEngine?: ((options: { readonly model: unknown; readonly locale?: string \| undefined; }) => unknown);` | optional, inherited | Creates the engine instead of the local one (a remote pivot source: `(o) => source.createEngine(o)` from `createJsonPivotSource()` of `@salmonui/data/json`). Its commands may answer asynchronously. Read on creation; the server renders the loading state. |
| `rowHeight` | `rowHeight?: number;` | optional, inherited |  |
| `columnWidth` | `columnWidth?: number;` | optional, inherited | Value column width in px. Default 120. |
| `rowHeaderWidth` | `rowHeaderWidth?: number;` | optional, inherited | Row header column width in px (compact) or per row field (tabular). Default 220 / 150. |
| `height` | `height?: string \| number;` | optional, inherited |  |
| `resizable` | `resizable?: boolean;` | optional, inherited |  |
| `reorderable` | `reorderable?: boolean;` | optional, inherited |  |
| `textWrap` | `textWrap?: "both" \| "content" \| "header" \| boolean;` | optional, inherited |  |
| `overflow` | `overflow?: "clip" \| "ellipsis" \| "ellipsisWithTooltip";` | optional, inherited |  |
| `gridLines` | `gridLines?: "both" \| "default" \| "horizontal" \| "none" \| "vertical";` | optional, inherited |  |
| `striped` | `striped?: boolean;` | optional, inherited |  |
| `highlightOnHover` | `highlightOnHover?: boolean;` | optional, inherited |  |
