@kanunilabs/pivotgrid-react / PivotLayoutState
Interface: PivotLayoutState
Controls pivot grid layout, totals visibility, and structural options.
Properties
allowFieldGrouping?
optionalallowFieldGrouping?:boolean
The field groups' items in the chip menu (Enterprise, B.120): "New group…", "Add to group ▸" (the groups by
name), "Remove from group", "Rename group…" and "Ungroup". false (default) draws none: an app that does not let
its users regroup sees no new menu items. A group's ⊟/⊞ button is drawn either way (the app's own groups). The
user's groups are field properties (group, groupCaption, groupExpanded): saved with the layout and in a
saved report, and reported by onFieldGroupChange and onFieldsChange. The app's setting: not saved with the
state.
areaChipOverflow?
optionalareaChipOverflow?:"scroll"|"shrink"|"wrap"|"fit"| {column?:PivotAreaChipOverflow;data?:PivotAreaChipOverflow; }
What the Values and Columns zones above the table do when their chips do not fit on one line (B.74). 'wrap'
(default) starts a new line, as before; 'scroll' keeps one line and scrolls it sideways (a quick swipe on
touch). Dragging a chip to the zone's edge scrolls it, like the field list. The filter strip keeps its own
rows (filterAreaMaxRows). 'shrink' (B.86) also keeps one line, but the chips narrow in proportion first so they
all fit: the caption is cut off (always clipped, whatever textOverflow says; the full name stays in the chip's
tooltip) down to a floor of 56px (--pivot-chip-shrink-min, never under 44px on touch); only when they do not fit
even at the floor does the line scroll sideways. A view setting.
'fit' (B.116) keeps one line that never scrolls and never cuts a chip off: every chip stays in the zone and the
chips narrow in proportion as far as the zone needs, with no floor; the gaps between chips, the chip's side padding
and the end drop target give way too. The Values zone is as wide as the row-header column(s), so with 'fit' it
first takes the Columns zone's free room (B.122): it grows over the start of the Columns strip to its chips' full
width and the Columns zone starts after it (a stronger line marks the boundary); only when both together do not fit
do they shrink — both by the same factor when the Columns zone fits too, else Values alone in the room Columns leaves.
Values is never narrower than the row headers, an empty Columns zone keeps room for a drop, the share follows the
visible width, and the table's columns do not move; in every rowHeaderOverflow mode. On a narrow phone the chips
can still become too small to read. Hovering anywhere on a chip shows its full name (the
chip's tooltip). A chip too narrow for its filter / remove buttons plus 16px to grab draws none, so it still drags,
sorts on a click and opens its menu on a right click (the menu also filters; so does Alt+ArrowDown). Keyboard
access and the accessible names do not change. On a touch screen (coarse pointer) a chip never goes under 44px and
the line scrolls past that, as 'shrink' does.
One value applies to both zones. An object sets them one by one; a zone it does not name wraps:
{ data: 'fit', column: 'fit' }.
areaHeaders?
optionalareaHeaders?:object
Which field zones draw their title row (B.104): the filter strip's "FILTER AREA" row (its name, its collapse
button and, collapsed, the count of filtering fields), and the "VALUES" / "COLUMNS" rows of the zones above the
table. Each defaults to true (today's look); false leaves the zone without its title row: the chips, the
empty zone's hint and the drop target stay where they were, and the zone keeps its name for assistive technology
(role="group" with an aria-label). Without its row the filter strip has no collapse button: the app collapses
it with filterAreaCollapsed (its own button). Collapsed to filterAreaCollapsedRows: 0 with no title row, the
filter strip has nothing to show and is not drawn at all, not even while a field is dragged; a field reaches it
again once the app opens it. A view setting. The app's setting: not saved with the state (getPersistedState,
stateStoring, reports), and a restored state keeps the grid's current value.
column?
optionalcolumn?:boolean
data?
optionaldata?:boolean
filter?
optionalfilter?:boolean
chartType?
optionalchartType?:string
Chart integration type when rendering in chart mode.
chipActions?
optionalchipActions?:object
The filter and remove buttons of a chip in the Values zone above the table (B.117). 'inline' (default) is
today's look: after the caption, faint until the pointer is over the chip, always taking their width. 'hover'
draws them only while the pointer is over the chip or the chip has the keyboard focus, OVER the end of the
caption, so they take no width and the chip is narrower by theirs; nothing moves when they appear. A filtered chip
hides them too and shows it is filtered when not hovered: its caption in the danger text colour and a thin danger
line along its bottom (both stay on a chip a few pixels wide); its accessible name ends in "filtered" in every
zone. A chip too narrow for the buttons plus 16px to grab draws none (see areaChipOverflow: 'fit'); its filter
is in its menu (right click, Shift+F10) and on Alt+ArrowDown. On a touch screen nothing changes (the chip's "…"
button opens its menu). Other zones and the field list keep their buttons as they are. The keys stay: Alt+ArrowDown
filters, Delete removes, Shift+F10 opens the menu. A view setting. The app's setting: not saved with the state,
and a restored state keeps the grid's current value.
data?
optionaldata?:"inline"|"hover"
chipMaxWidth?
optionalchipMaxWidth?:number|"none"|"auto"
The widest a field chip's caption grows, in px (B.62). Default 120. 'none'
lets the caption keep its whole text; 'auto' sizes the chip to its caption,
up to 280px. A cut caption shows its whole text as a tooltip. A view setting.
dataFieldPosition?
optionaldataFieldPosition?:"rows"|"columns"
Place data field labels in row headers or column headers.
dateIntervalChoices?
optionaldateIntervalChoices?:"standard"|"calendar"
Which date intervals the field settings dialog's Quarter, Month and Week entries pick (B.121). 'standard'
(default): 'quarter', 'month', 'week', as before. 'calendar': the same entries, with the same labels, pick
'yearQuarter' ("2026-Q1", "2026-Ç1" in Turkish), 'yearMonth' ("2026-01") and 'monthWeek'
("2026-01-1"). A field whose own definition still has an old interval lists it as its own first entry,
written with a sample ("Quarter (Q1)"): OK keeps it, picking Quarter switches it.
'calendar' also CONVERTS restored and applied states (B.121, so that one switch means one kind of interval and a
saved report never shows "Q1" beside a dialog offering "2026-Ç1"): a date field with 'quarter', 'month' or
'week' in a state put back by applyPersistedState, stateStoring (also an asynchronous onLoad), a saved
report (loadReport, the default report) or setFields becomes 'yearQuarter', 'yearMonth', 'monthWeek'.
Its members change, so what named the old ones is DROPPED: that field's header filter selection, its label filter,
every open group through it and a summary sort whose path runs through it. Its value filter and the rest of the
state are restored as saved. The app's own initialFields are not converted. A view setting. The app's setting:
not saved with the state, and a restored state keeps the grid's current value.
filterAreaCollapsed?
optionalfilterAreaCollapsed?:boolean
The filter strip shows one row of chips and how many of its fields filter (B.38); the strip's own button toggles it. Saved with the layout like every other member. A view setting, as above.
filterAreaCollapsedRows?
optionalfilterAreaCollapsedRows?:number
How many rows of chips the COLLAPSED filter strip shows (B.63). Default 1. 0 leaves only the strip's header: its name, how many of its fields filter, and the button that opens it. A view setting; the app's, not saved by the collapse button.
filterAreaMaxRows?
optionalfilterAreaMaxRows?:number
The tallest the filter strip grows, in rows of chips (B.38). Past it the strip scrolls inside itself, and a field dragged to its top or bottom edge scrolls it. Default: no limit. A view setting: changing it does not re-run the pivot.
filterPopupSearch?
optionalfilterPopupSearch?:boolean
The search box at the top of the header filter popup (a field's value list, B.90). Default true. false leaves
the plain list: no box, no type-ahead; Select All / Clear All, the arrow keys, Space, Enter and Escape work as
before, and the rows are still grouped by their label (B.88). A view setting. The app's setting: not saved with
the state, and a restored state keeps the grid's current value.
hideEmptySummaryCells?
optionalhideEmptySummaryCells?:boolean
Hide rows/columns that have no data.
prefilter?
optionalprefilter?:FilterGroup
Server-side or computed prefilter applied before aggregation.
rowFieldChips?
optionalrowFieldChips?:"aligned"|"packed"
How the row-field chips sit above the row headers (B.112), in a tabular row layout. 'aligned' (default,
today's look): each chip heads its row-header column and is as wide as that column, so wide columns leave wide
gaps. 'packed': the chips sit side by side in one strip across the block, with the small regular gap of the
filter area, and wrap onto more lines when the block is narrow. The columns keep their widths and their resize
grips (drawn on the column edges), and every chip is still a drag target. The tree layout already packs its
chips. A view setting; the app's own, not saved with the state. React and plain JS.
rowHeaderGroupLines?
optionalrowHeaderGroupLines?:boolean
A line at the bottom of every row-header group, in every row-header column (B.79 / B.81): where a group spanning
several rows ends, and between two subtotal rows in a row, where the row-header block drew no line. The data cells
do not change, and neither does the row height (the line is the same 1px bottom border a one-row group already
has). Default false (today's look). The cells say where a group starts and ends in either case
(data-group-start, data-group-end). A view setting.
rowHeaderLayout?
optionalrowHeaderLayout?:"tabular"|"tree"
Row header style: 'tabular' gives one column per row field, 'tree' nests all into one column.
rowHeaderOverflow?
optionalrowHeaderOverflow?:"scroll"|"shrink"|"unpin"
What the row-header block does when its columns do not fit (B.64).
'shrink' (default): the block is held to 60% of the width and every
column is squeezed to fit, down to 56px each. 'scroll': each column
keeps its width. React: the block stays pinned, is held to 60% of the
width, and scrolls sideways inside itself (touch, trackpad or Shift+wheel;
its scrollbar is hidden so the rows stay aligned with the data). Plain JS:
the row headers are not pinned; the whole table scrolls sideways. A view
setting.
'unpin': the row headers are never pinned; the whole table (headers and
data) scrolls sideways as one, each column at its width. Plain JS already
scrolls the whole table, so there 'scroll' and 'unpin' behave alike.
Whatever the value, the block lets go of its pin by itself when its columns, each at the 56px floor, cannot leave the data 160px (columns x 56
- 160 > the pivot's width): squeezing cannot help then, and the data would
be out of reach. Otherwise
'shrink'and'scroll'act as described.
rowHeaderToggle?
optionalrowHeaderToggle?:"cell"|"button"
What opens and closes a row group on a click (B.110). 'cell' (the default, today's behaviour): a click on
the row-header cell, on the collapsed group's spanning label too, selects it AND toggles the group. 'button':
a click on the cell or the label only selects it (the press that selects the header for Selection Details or
Ctrl+C no longer closes the group); only the +/− box toggles. The keys are the same in both: Enter, Space,
- and − on the focused header. Column headers already toggle from the +/− box only, in both modes. With
(pointer: coarse)the +/− box's hit area is at least 44 × 44 px (its drawing stays the same size). A view setting. The app's setting: not saved with the state (getPersistedState,stateStoring, reports), and a restored state keeps the grid's current value.
scrollbarStyle?
optionalscrollbarStyle?:"thin"|"native"
The scrollbars inside the pivot (B.70). 'thin' (default) is the
stylesheet's slim, rounded bar. 'native' leaves them to the browser: on
Windows the classic wide bar with arrows. Needs the stylesheet of this
release or later. A view setting.
showChipRemove?
optionalshowChipRemove?:boolean
Show the remove (x) button on a field chip (B.62 addendum). Default true;
false hides it (a field still leaves by dragging it to the field list, by
Delete on the focused chip, or from the chip's menu). A view setting. The
gap between a chip's caption and its filter icon is the CSS variable
--pivot-chip-filter-gap (default 4px), set on the pivot or above it.
showColumnGrandTotals?
optionalshowColumnGrandTotals?:boolean
The grand total COLUMN, at the end of every row.
showColumnTotals?
optionalshowColumnTotals?:boolean
Per-level subtotals on the column axis: an expanded column group gets a
total column (before or after its children, per totalsPosition).
Default true.
showFilterArea?
optionalshowFilterArea?:boolean
showFooter?
optionalshowFooter?:boolean
showGrandTotalHeader?
optionalshowGrandTotalHeader?:boolean
With no field in the column area, put a "Grand Total" heading (the
dictionary's grandTotal) over the measure headers (B.69). Default false.
Ignored while a column field exists: the grand-total column has its own
heading then. The Excel, PDF, print and clipboard exports carry the row too.
A view setting.
showGrandTotals?
optionalshowGrandTotals?:"none"|"rows"|"columns"|"both"
Coarse form of showRowGrandTotals + showColumnGrandTotals. Bridged to
them at the controller boundary; an explicitly passed granular flag wins.
showGrandTotalsForSingleValues?
optionalshowGrandTotalsForSingleValues?:boolean
The grand total of an axis whose top level has a single member (B.39).
false leaves out the grand total row when there is one top-level row
member, and the grand total column when there is one top-level column
member. Default true.
showRowGrandTotals?
optionalshowRowGrandTotals?:boolean
The grand total ROW, at the end of the grid.
showRowTotals?
optionalshowRowTotals?:boolean
Per-level subtotals on the row axis.
showSubTotals?
optionalshowSubTotals?:"none"|"rows"|"columns"|"both"
Coarse form of showRowTotals + showColumnTotals. Bridged at the
controller boundary; an explicitly passed granular flag wins.
showSummaryBadge?
optionalshowSummaryBadge?:boolean
Show the summary-type badge ("Sum") on the chips of the data area (B.62).
Default true; false hides it (the chip's accessible name still says it).
A view setting.
showTotalsForSingleValues?
optionalshowTotalsForSingleValues?:boolean
Subtotals of a group with exactly ONE child (B.39). false leaves them
out — the child's own row or column already shows the same numbers — on
screen and in every export, on both axes. Default true.
textOverflow?
optionaltextOverflow?:"ellipsis"|"clip"
What happens to text that does not fit (B.82): the field chips (every strip, the field list, the drag
ghost) and the row-header values, "Total: ..." included. 'ellipsis' (default) ends it with "...";
'clip' cuts it off at the edge. Number cells never change. A cut row-header value carries its whole
text as a tooltip in 'clip' mode. A view setting.
totalsDisplayMode?
optionaltotalsDisplayMode?:"top"|"bottom"
Alias of totalsPosition, bridged at the controller boundary.
totalsPosition?
optionaltotalsPosition?:"top"|"bottom"
Whether subtotals appear above or below their groups.
viewOptionsMenu?
optionalviewOptionsMenu?:object
Which items the View options menu (right-click on a data cell) lists (B.93). Both default
to true. footer: false leaves out "Footer bar" and filterArea: false leaves out "Filter area":
use it when the app decides that bar itself (showFooter: false) and the user must not bring it
back. With both false the menu does not open. It changes what the menu offers, not what the
layout is: showFooter and showFilterArea still apply, and setLayout can still change them.
A view setting. The app's setting: not saved with the state (getPersistedState, stateStoring,
reports), and a restored state keeps the grid's current value. While an item is left out, the
reader cannot switch that bar, so a restored state keeps the grid's current showFooter /
showFilterArea too; a listed item's saved value is restored as before.
filterArea?
optionalfilterArea?:boolean
footer?
optionalfooter?:boolean
virtualization?
optionalvirtualization?:PivotVirtualizationOptions
How the body draws its rows (B.96). With no setting, nothing changes: only the rows in view are drawn,
plus a small margin. See PivotVirtualizationOptions. A view setting: it can change on a live grid, the
body is redrawn and the data is not recomputed. The app's setting: not saved with
the state (getPersistedState, stateStoring, reports), and a restored state keeps the grid's current value.