Virtualization
Preview

Control DataGrid row virtualization and inspect its resolved geometry.

Overview

DataGrid automatically virtualizes large final row models and keeps smaller tables in normal document flow. The decision uses the visible rows and columns after filtering, grouping, expansion, and pivoting, so the same table can move between native and virtual geometry as its view changes.

Leave rowVirtualization="auto" for normal use. Use "always" for a known large surface or performance test, and "never" for a known-small table that requires native row geometry. Vertical Cell Spanning also requires "never".

Rows can have different heights and are measured after mounting. estimatedRowHeight supplies the initial estimate. Adjust overscan only after measuring visible blanking or unnecessary mounted work. Top- and bottom-pinned rows remain mounted outside the virtual centre region.

Example

The toolbar is ordinary viewport content rather than a virtual row. Scroll it away to keep the table header at the top. Search to reduce the row model below the automatic threshold; clear the search to return to virtual geometry.

Diagnostics

Use onDiagnosticsChange on performance and test surfaces that need the configured and resolved geometry, render-work estimate, and input-versus-mounted dimensions. No diagnostic snapshots are created when the callback is omitted. Expanded detail content is not included in mounted row or cell counts.

<DataGrid.Viewport
  aria-label="Matters"
  onDiagnosticsChange={diagnosticsStore.publish}
/>

API Reference

DataGrid.Viewport

PropTypeDefaultDescription
rowVirtualization"auto" | "always" | "never""auto"Selects adaptive, forced virtual, or forced native row geometry.
virtualizationThresholdnumber180000Render-work threshold used by automatic virtualization.
virtualizationOverscannumber5Rows mounted beyond each visible edge.
estimatedRowHeightnumber48Initial pixel estimate used until each mounted row is measured.
onDiagnosticsChange(diagnostics: DataGridDiagnostics) => void-Reports geometry, render work, and input-versus-mounted dimensions.

Virtualization limits mounted DOM nodes without changing the final row model. Table APIs and accessibility row counts continue to describe all rendered-model rows.

DataGridDiagnostics

FieldTypeDescription
geometry.configured"auto" | "always" | "never"Requested row-virtualization mode.
geometry.resolved"native" | "virtual"Geometry currently used by the viewport.
geometry.reasonDataGridDiagnostics["geometry"]["reason"]Reason for the resolved geometry.
geometry.estimatedRenderWorknumberEstimated work used by automatic mode.
geometry.renderWorkThresholdnumberThreshold compared with the estimate.
inputsDataGridDiagnosticsDimensionsRows, columns, and body cells before virtualization.
mountedDataGridDiagnosticsDimensionsData rows, columns, and body cells currently mounted.

DataGridDiagnosticsDimensions

FieldTypeDescription
bodyCellsnumberData-body cells in the snapshot. Expanded-detail content is excluded.
columns{ start: number, center: number, end: number, total: number }Visible column counts by pinning region and in total.
rows{ top: number, center: number, bottom: number, total: number }Data-row counts by pinning region and in total.

On this page