list virtualization
Rendering only the rows of a long list that are currently visible, plus a few extra, instead of creating DOM nodes for every item.
In more detail
A tall spacer element gives the scrollbar the full list height, and visible rows are positioned inside it with translateY. As the user scrolls, the start and end indexes are recalculated from scrollTop, row height and viewport height. Libraries such as TanStack Virtual handle variable row heights.
Related terms
- viewport — The visible area of a web page in the browser window or device screen.
- overscan — Extra rows a virtualised list renders just above and below the viewport so fast scrolling does not show blank gaps.
- spacer element — An empty element sized to the full height of all list items so the scrollbar behaves as if every item were rendered.
- TanStack Virtual — A headless library for virtualising long lists and grids, including rows of different or changing heights.
- scroll event — The event fired when a page or element scrolls; scrolling of an element does not bubble to the document.
Taught in
- Higher-Order Components And Render Props: Tradeoff Analysis — React 19 & Modern Component Architecture
- The React Compiler: Automated Memoization Under The Hood — React 19 & Modern Component Architecture
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture