Documentation

@kanunilabs/pivotgrid-react


@kanunilabs/pivotgrid-react / BasePivotGridProps

Interface: BasePivotGridProps<TRow>

Props for the BasePivotGrid component. This is the enterprise-grade data orchestration layer for analytics.

Type Parameters

TRow

TRow

Properties

advancedExport?

optional advancedExport?: boolean

Enables the Enterprise-only styled Excel & PDF export items in the footer. Set by EnterprisePivotGrid; in the Community build those items render locked.


asyncTransactionWait?

optional asyncTransactionWait?: number

How long ref.applyTransactionAsync collects transactions before applying them together. Default 50 ms.


chartIntegrationOptions?

optional chartIntegrationOptions?: PivotChartIntegrationOptions & object

Configuration for chart synchronization.

Type Declaration

chartType?

optional chartType?: string


columnar?

optional columnar?: boolean

Keep the rows as typed columns instead of row objects (Enterprise, EnterprisePivotGrid only; B.111): for 1–2 million rows. Read when the grid is created. See PivotControllerOptions.columnar.


customContextMenuItems?

optional customContextMenuItems?: (field) => object[]

Customize the context menu items for a specific field.

Parameters

field

PivotField<TRow>

Returns

object[]


dark?

optional dark?: boolean

The built-in dark look (the DataGrid's dark palette). A palette decides its own mode and wins.


data

data: TRow[] | PivotRowChunk<TRow>

The raw tabular data array. A NEW array replaces every row; passing the same array again (any re-render) does not, so rows changed through ref.applyTransaction stay changed; a new empty array clears them. With columnar, also a { columns, rows } chunk, the same while its rows and columns arrays are (B.111).


defaultColumnWidths?

optional defaultColumnWidths?: PivotColumnWidthDefaults

Starting widths in pixels: { rowHeader, data } for every row-header column and every data column. Defaults 150 and 95. A width the user drags (or ref.setColumnWidths writes) still wins; see PivotControllerState.columnWidths for its keys.


density?

optional density?: PivotDensity

Row rhythm: 'compact' (24px rows, one size smaller type), 'normal' (28px, the default), 'comfortable' (36px) or 'touch' (45px rows and headers, every target 44px, for a touch screen). Changing it repaints in place, without re-running the pivot engine.


dictionary?

optional dictionary?: Partial<PivotDictionary>

Dictionary for localized strings (i18n).


disabled?

optional disabled?: boolean

Disables all interactive features (drag & drop, expand/collapse, context menu, filtering, etc.)


fieldChooserMode?

optional fieldChooserMode?: "modal" | "panel"

How the field chooser opens (B.37). 'modal' (the default): a floating window over a backdrop that covers the pivot. 'panel': a panel beside the pivot, at its end side, with no backdrop: the pivot stays usable, and a field drags both ways between the two — from the list to any strip or row header, from a pivot chip back to the list (which hides it). The footer button, openFieldChooser and closeFieldChooser open and close it either way. On a screen 768px wide or narrower the panel falls back to the full-screen chooser. Its width is the CSS variable --pivot-chooser-panel-width (default 320px).


fieldGroupTools?

optional fieldGroupTools?: PivotFieldGroupTools

Field groups on (B.118-B.120): EnterprisePivotGrid passes core's pivotFieldGroupTools. Not for apps — groups are Enterprise; without it group on a field does nothing and nothing of a group is drawn.


fields?

optional fields?: PivotField<TRow>[]

Controlled field configuration. If provided, component acts as controlled.


gridId?

optional gridId?: string

Optional identifier for the grid instance. Used for report storing and caching.


initialFields?

optional initialFields?: PivotField<TRow>[]

Initial field configuration (Uncontrolled mode).


keyboardNavigation?

optional keyboardNavigation?: object

Configuration for keyboard navigation and accessibility.

enabled

enabled: boolean


layout?

optional layout?: PivotLayoutState

Controlled layout configuration.


loading?

optional loading?: boolean

The rows are still being fetched: while true, a grid with no result shows its loader instead of the "no data" text (mount with data={[]}, fill it with applyTransactionAsync, then set it to false). A result already on screen stays. Exports do not wait for it.


locale?

optional locale?: PivotLocale

Interface language: 'en', 'tr', 'ar', 'de', 'fr', 'es', 'it', 'pt', 'ru', 'zh-CN', 'ja' or 'ko'. Defaults to 'en'. Also sets the number formatting, and right-to-left for 'ar' (see rtl).


maxColumns?

optional maxColumns?: number

Most column members drawn (default 1000); past it the grid says so and totals still count all the data. 0 or Infinity turns the cap off.


maxLiveOpenNodes?

optional maxLiveOpenNodes?: number

Default 500,000: while rows stream in under expand-all, a live compute that would build more row nodes than this is held back until the feed ends (or a reader action, an export, ~2 s without new rows, a shown result 5 minutes old). 0 or Infinity turns it off; see the core option.


maxRestoredOpenNodes?

optional maxRestoredOpenNodes?: number

Opt-in (off by default): most row nodes the grid may hold for an open state put back from storage or a report (under '*' closed branches count too); see the core option.


onAfterPivotCalculate?

optional onAfterPivotCalculate?: (result) => void

Fired after the Pivot matrix compute cycle completes successfully.

Parameters

result

PivotEngineResult

Returns

void


onBeforePivotCalculate?

optional onBeforePivotCalculate?: () => void

Fired immediately before the Pivot matrix compute cycle begins.

Returns

void


onCellClick?

optional onCellClick?: (e) => void

Fired when any cell is clicked (data cells, row headers, grand totals). Replaces the deprecated onDrillDown handler. This is the single source of truth for cell interactions.

Parameters

e

CellClickEvent<TRow>

Returns

void


onCellPrepared?

optional onCellPrepared?: (e) => void

Fired after a cell is prepared to allow modifications.

Parameters

e

CellPreparedEvent<TRow>

Returns

void


onChartStateLoaded?

optional onChartStateLoaded?: (chartState) => void

Callback to receive loaded chart state.

Parameters

chartState

PivotChartIntegrationOptions & object

Returns

void


onChartSync?

optional onChartSync?: (syncResult) => void

Callback to receive chart integration payload.

Parameters

syncResult

ChartSyncResult

Returns

void


onComputingChange?

optional onComputingChange?: (computing) => void

The pivot started (true) or finished (false) computing a change — data, fields, a filter, an expand. While it is true the table on screen is the previous result; exportData waits for false by itself (B.31). The export waits without a time limit, a slow serverSource.compute included. Print and clipboard run after the wait, so a browser may refuse them once the click that asked for them has expired.

Parameters

computing

boolean

Returns

void


onCopy?

optional onCopy?: (event) => void

Ctrl/Cmd+C copied the selected cells (B.99): the tab-separated text, the same cells as an html table, and the size. The copy goes through the browser's own copy event, so it works on a plain-HTTP page too.

Parameters

event

PivotCopyInfo

Returns

void


onCopyError?

optional onCopyError?: (error, info) => void

A Ctrl/Cmd+C did not reach the clipboard (B.99): reason is 'insecure-context' (no clipboard on a plain-HTTP page and no copy event), 'permission-denied' (the browser refused), 'empty-selection' (the focus was in the grid with nothing selected) or 'unsupported'. Show the user something; the grid does not.

Parameters

error

PivotCopyError

info
reason

PivotCopyErrorReason

Returns

void


onError?

optional onError?: (error) => void

Fired when a critical engine error occurs.

Parameters

error

Error

Returns

void


onExporting?

optional onExporting?: (e) => void

Fired when an export action is initiated. Can be canceled.

Parameters

e

ExportingEvent

Returns

void


onFieldGroupChange?

optional onFieldGroupChange?: (e) => void

A field group changed from the screen (Enterprise, B.120): created, joined, left, renamed, ungrouped, collapsed or opened. After the change.

Parameters

e

PivotFieldGroupChangeEvent<TRow>

Returns

void


onFieldMove?

optional onFieldMove?: (e) => void | Promise<void>

Fired when a field is moved within the PivotGrid (drag & drop). Provides a validate/cancel hybrid model. If it returns a Promise, the component awaits validation before committing the DND state.

Parameters

e

FieldMoveEvent

Returns

void | Promise<void>


onFieldsChange?

optional onFieldsChange?: (fields) => void

Fired when fields configuration changes.

Parameters

fields

PivotField<TRow>[]

Returns

void


onLargeExport?

optional onLargeExport?: (info) => boolean | void | Promise<boolean | void>

Asked before a styled Excel export gives way to the plain .xls one (over 100,000 list rows or 150,000 pivot cells); return false to cancel (B.23).

Parameters

info

LargeExportInfo

Returns

boolean | void | Promise<boolean | void>


onLayoutChange?

optional onLayoutChange?: (layout) => void

Fired when layout options change.

Parameters

layout

PivotLayoutState

Returns

void


onOpenFullScreenChart?

optional onOpenFullScreenChart?: () => void

Returns

void

Deprecated

NEVER FIRES. Declared, never destructured, never called — there is no code path that reaches it, and there never was. The doc comment here used to read "fired when the full screen chart icon is clicked", which is the reason it survived: it looked implemented in the API reference. Use chartIntegrationOptions instead. Removed in the next major.


onReady?

optional onReady?: (controller) => void

The grid's controller, once, after its first render (again only if a new gridId gives it a new one). Keep it for anything that runs while the grid may be hidden: React sets ref.current to null while <Activity mode="hidden"> hides the grid, and the controller keeps taking transactions then (B.108).

Parameters

controller

PivotController<TRow>

Returns

void


onRefresh?

optional onRefresh?: () => void

Callback fired when the refresh button is clicked.

Returns

void


onRestoredExpansionCollapsed?

optional onRestoredExpansionCollapsed?: (e) => void

The open state put back was dropped because the tree would not fit in memory; the grid opened collapsed (once; twice under React StrictMode in development).

Parameters

e
limit

number

nodes

number

Returns

void


onSelectionChange?

optional onSelectionChange?: (event) => void

Every change of the selected data cells (B.25): count, and cells (paths, data field, value, kind) built when read. On Enterprise, Shift extends the selection, Ctrl/Cmd adds a rectangle, and on a touch screen a long press adds one and a drag grows it.

Parameters

event

PivotSelectionChangeEvent

Returns

void


onToggleChart?

optional onToggleChart?: () => void

Callback fired when chart toggle is clicked.

Returns

void


palette?

optional palette?: string

A colour scheme by id — one of the 36 packaged ones ('nord', 'graphite'…, with @kanunilabs/pivotgrid-react/themes/<id>.css imported after styles.css) or your own from the Theme Builder. The same name as the DataGrid's palette, so one value colours both. Wins over theme.id.


registry?

optional registry?: PivotEngineRegistry

The plugin registry containing custom functions and formatters.


renderCalculatedFieldModal?

optional renderCalculatedFieldModal?: (props) => ReactNode

Slot for injecting Enterprise Calculated Field Modal

Parameters

props

any

Returns

ReactNode


renderNodeContextMenu?

optional renderNodeContextMenu?: (props) => ReactNode

Overrides the built-in node context menu (Community since 2026-08-30); omit to get the default right-click expand/collapse menu

Parameters

props

any

Returns

ReactNode


renderPrefilterBuilder?

optional renderPrefilterBuilder?: (props) => ReactNode

Slot for injecting Enterprise Prefilter Builder

Parameters

props

any

Returns

ReactNode


rowKey?

optional rowKey?: PivotRowKeyResolver<TRow>

What identifies a row for ref.applyTransaction: a field name, or a function returning a string or number. Without it rows are matched by object identity.


rtl?

optional rtl?: boolean

Right-to-Left (RTL) mode. Defaults to false (except for 'ar').


optional search?: boolean

A search box in the footer: shows only the row members whose caption contains the text, on top of the reader's own filters. Default false. ref.setSearchText(text) works either way.


serverSource?

optional serverSource?: PivotServerSource

Server-side pivot (Enterprise): the server aggregates; data is not read.


stateStoring?

optional stateStoring?: PivotStateStoringConfig

Configuration for state storing (localStorage, sessionStorage, etc).


striped?

optional striped?: boolean

Apply zebra striping to the data rows.


theme?

optional theme?: PivotTheme

Custom theme configuration.


toolbar?

optional toolbar?: PivotToolbarConfig

Configuration for the toolbar visibility and features.


touchChipTap?

optional touchChipTap?: PivotTouchChipTap

What a short tap on a field chip does on a touch screen: 'sort' (the default, as a click does), 'menu' (opens the chip's menu) or 'none'.


touchDragDelay?

optional touchDragDelay?: number

How long (ms) a finger holds still on a field chip before it drags (a customer B.35). Moving sooner scrolls the page instead. Default 200. Holding still a further 350 ms opens the chip's menu. A mouse or a pen drags after 8 px.


upgradeUrl?

optional upgradeUrl?: string

URL opened when a Community user clicks a locked Enterprise export item (e.g. your pricing / Enterprise sales page).


workerUrl?

optional workerUrl?: string | URL

Explicit URL for the engine Web Worker script. Required in bundlers that cannot statically resolve the default new URL('./pivot.worker.js', import.meta.url) (e.g. Next.js). Copy the worker from @kanunilabs/pivotgrid-core/dist/pivot.worker.js into a served path and point this at it, e.g. /kanunilabs/pivot.worker.js.