API reference: @salmonui/pivot-table
PivotTablecomponent
import { PivotTable } from '@salmonui/pivot-table';function PivotTable<Row = unknown>(own: PivotTableProps<Row>): ReactNode;
The pivot table.
Props: PivotTableProps
| Name | Signature | Description |
|---|---|---|
pivotoptional | pivot?: PivotController<Row> | undefined; | A shared store from |
layoutoptional | layout?: PivotTableLayout | undefined; |
|
fieldListoptional | fieldList?: boolean | 'popup' | undefined; | Built-in field list: |
axisBaroptional | axisBar?: boolean | PivotAxisBarOptions | undefined; | Built-in axis bar above the table. |
toolbaroptional | toolbar?: readonly (PivotToolbarItemId | PivotToolbarItem)[] | undefined; | Built-in toolbar items above the table. |
drillThroughoptional | drillThrough?: boolean | {
readonly maxRows?: number;
} | undefined; | Double-click or Enter on a value cell opens its raw rows. |
valueSortingoptional | valueSorting?: boolean | {
readonly multipleAxis?: boolean;
} | undefined; | 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). |
editingoptional | editing?: boolean | DataGridEditing<Row> | undefined; | Editing of the drill-through grid; edits write through and re-aggregate. |
pagingoptional | paging?: boolean | {
readonly rows?: number;
readonly columns?: number;
} | undefined; | Paging instead of virtualization (opt-in): page sizes for rows and
columns. |
aggregateOptionsoptional | aggregateOptions?: readonly PivotAggregate[] | undefined; | Aggregates offered by the value field menus. |
selectionoptional | selection?: boolean | {
readonly multiple?: boolean;
} | undefined; | Cell selection. Default off. |
emptyCellTextoptional | emptyCellText?: string | undefined; | Text of empty value cells. Default ''. |
renderCelloptional | renderCell?: ((ctx: PivotCellContext) => ReactNode) | undefined; | |
renderHeaderoptional | renderHeader?: ((ctx: PivotHeaderContext) => ReactNode) | undefined; | |
renderTooltipoptional | renderTooltip?: ((ctx: PivotTooltipContext) => ReactNode) | undefined; | |
renderLoadingoptional | renderLoading?: ((ctx: PivotLoadingContext) => ReactNode) | undefined; | |
getCellClassNameoptional | getCellClassName?: ((ctx: PivotCellContext) => string | undefined) | undefined; | |
onCellClickoptional | onCellClick?: ((event: PivotCellClickEvent) => void) | undefined; | |
persistStateoptional | persistState?: PivotPersistState | undefined; | Saves the model in storage and restores it on mount. |
exportWritersoptional | exportWriters?: PivotExportWriters | undefined; | Export writer loader: a dynamic import of the |
localeTextoptional | localeText?: PivotLocaleText | undefined; | |
idoptional | id?: string | undefined; | |
classNameoptional | className?: string | undefined; | |
styleoptional | style?: CSSProperties | undefined; | |
aria-labeloptional | 'aria-label'?: string | undefined; | |
refoptional | ref?: Ref<PivotTableApi<Row>> | undefined; | |
onBeforePivotModelChangeoptionalinherited | onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void); | |
onPivotModelChangeoptionalinherited | onPivotModelChange?: ((event: PivotModelChangeEvent) => void); | |
onBeforeExpandedChangeoptionalinherited | onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void); | |
onExpandedChangeoptionalinherited | onExpandedChange?: ((event: PivotExpandedChangeEvent) => void); | |
onBeforeFilterChangeoptionalinherited | onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void); | |
onFilterChangeoptionalinherited | onFilterChange?: ((event: PivotFilterChangeEvent) => void); | |
onBeforeSortChangeoptionalinherited | onBeforeSortChange?: ((event: PivotSortChangeEvent) => void); | |
onSortChangeoptionalinherited | onSortChange?: ((event: PivotSortChangeEvent) => void); | |
onBeforeFieldMoveoptionalinherited | onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void); | |
onFieldMoveoptionalinherited | onFieldMove?: ((event: PivotFieldMoveEvent) => void); | |
onBeforeMemberEditorOpenoptionalinherited | onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void); | |
onBeforeAggregateMenuOpenoptionalinherited | onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void); | |
onBeforeCalculatedFieldChangeoptionalinherited | onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void); | |
onCalculatedFieldChangeoptionalinherited | onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void); | |
onBeforeDrillThroughoptionalinherited | onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void); | |
onDrillThroughoptionalinherited | onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void); | |
onBeforeSelectionChangeoptionalinherited | onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void); | |
onSelectionChangeoptionalinherited | onSelectionChange?: ((event: PivotSelectionChangeEvent) => void); | |
onDataChangeoptionalinherited | onDataChange?: ((event: PivotDataChangeEvent<Row>) => void); | |
onComputeStartoptionalinherited | onComputeStart?: ((event: PivotComputeEvent) => void); | |
onComputeEndoptionalinherited | onComputeEnd?: ((event: PivotComputeEvent) => void); | |
onBeforeExportoptionalinherited | onBeforeExport?: ((event: PivotExportEvent) => void); | |
onExportoptionalinherited | onExport?: ((event: PivotExportEvent) => void); | |
onErroroptionalinherited | onError?: ((event: PivotErrorEvent) => void); | |
dataoptionalinherited | data?: readonly Row[]; | Raw rows by reference. Reactive: a new array re-aggregates (incrementally for small deltas). |
fieldsoptionalinherited | fields?: readonly PivotFieldDefinition<Row>[]; | Field definitions; inferred from the first rows when omitted. Read on creation. |
pivotModeloptionalinherited | pivotModel?: PivotModelInput; | Reactive report model: re-applied when it changes structurally, never reset by an equal fresh literal. |
defaultPivotModeloptionalinherited | defaultPivotModel?: PivotModelInput; | Initial report model (uncontrolled). |
localeoptionalinherited | locale?: string; | |
customAggregatesoptionalinherited | customAggregates?: Readonly<Record<string, PivotCustomAggregator<unknown>>>; | |
getCellValueoptionalinherited | getCellValue?: ((cell: PivotCell) => number | null); | Pure value override per cell. |
workeroptionalinherited | worker?: PivotWorkerLike; | Runs the engine in this Worker ( |
deferComputeAboveoptionalinherited | deferComputeAbove?: number; | Rows above which the first compute is deferred to the client after the first paint (the server renders the
header and a loading state, |
createEngineoptionalinherited | createEngine?: ((options: { readonly model: unknown; readonly locale?: string | undefined; }) => unknown); | Creates the engine instead of the local one (a remote pivot source: |
rowHeightoptionalinherited | rowHeight?: number; | |
columnWidthoptionalinherited | columnWidth?: number; | Value column width in px. Default 120. |
rowHeaderWidthoptionalinherited | rowHeaderWidth?: number; | Row header column width in px (compact) or per row field (tabular). Default 220 / 150. |
heightoptionalinherited | height?: string | number; | |
resizableoptionalinherited | resizable?: boolean; | |
reorderableoptionalinherited | reorderable?: boolean; | |
textWrapoptionalinherited | textWrap?: "both" | "content" | "header" | boolean; | |
overflowoptionalinherited | overflow?: "clip" | "ellipsis" | "ellipsisWithTooltip"; | |
gridLinesoptionalinherited | gridLines?: "both" | "default" | "horizontal" | "none" | "vertical"; | |
stripedoptionalinherited | striped?: boolean; | |
highlightOnHoveroptionalinherited | highlightOnHover?: boolean; |