Knowledge base from the official TanStack Virtual documentation (tanstack.com/virtual) - a headless library for virtualizing large scrollable lists, grids, and tables at 60fps for React, Vue, Solid, Svelte, Angular, Lit, and Marko. Use when building or debugging a virtualized list/table with useVirtualizer, tuning fixed vs dynamic item size measurement, implementing sticky headers, infinite scroll, window virtualization, or text-measurement-based (pretext) sizing.
Package: @tanstack/react-virtual (+ @tanstack/virtual-core, per-framework adapters) | Chapters: 20 (5 Getting Started + 1 Guide + 2 API + 12 Examples) | Generated: 2026-08-25
dynamic size, sticky headers, infinite scroll, window virtualization, etc.; read the matching chapterch010; load that specific chapterWhen a topic is not covered in Core Patterns below, read the relevant chapter file before answering.
overflow: auto. Give the inner element getTotalSize() along the virtualized axis and position rendered items absolutely.count, getScrollElement, and estimateSize; render getVirtualItems() and use each item's key, index, start, and size.estimateSize as the initial geometry. For dynamic DOM content, attach ref={virtualizer.measureElement} and data-index to rendered items. Do not mix measureElement and resizeItem for the same index.getItemKey when items can be prepended, removed, or reordered. Index keys identify positions, not records.overscan adds items outside the viewport. The examples use 5 for many lists, 6 for chat, and 20 for the table; tune it against scroll velocity, render cost, and blanking risk.lanes for masonry-like multi-lane layouts.paddingStart and paddingEnd for virtual content space. Use scrollPaddingStart and scrollPaddingEnd so imperative scrolling leaves fixed UI such as a header visible.anchorTo: 'end', stable message keys, and followOnAppend. Prepending then preserves the user's visual anchor.useWindowVirtualizer and account for the list's page offset with scrollMargin.rangeExtractor to add the active sticky index to the default range, then render that item without its normal transform and with a higher zIndex.onChange(instance, sync) can drive non-React DOM updates for high-frequency scroll work. React-specific directDomUpdates and useFlushSync are opt-in trade-offs, not first-line requirements.| # | Title | Key Concepts |
|---|---|---|
| ch001 | Introduction | headless, Virtualizer, axes |
| ch002 | Installation | adapters, packages, React 19 |
| ch003 | React Virtual | hooks, rendering, React options |
| ch004 | Other Framework Adapters | Angular, Solid, Svelte, Vue, Marko |
| ch005 | Text Measurement with Pretext | canvas measurement, caching, fonts |
| # | Title | Key Concepts |
|---|---|---|
| ch006 | Chat | end anchoring, prepend, follow |
| # | Title | Key Concepts |
|---|---|---|
| ch007 | Virtualizer | options, methods, measurement |
| ch008 | VirtualItem | geometry, key, lane |
| # | Title | Key Concepts |
|---|---|---|
| ch009 | Example: Fixed Size | rows, columns, grid |
| ch010 | Example: Variable Size | estimates, lanes, grid |
| ch011 | Example: Dynamic Size (measured) | measureElement, window |
| ch012 | Example: Pretext Measurement | text sizing, cache |
| ch013 | Example: Padding | paddingStart, paddingEnd |
| ch014 | Example: Scroll Padding | measured header, scroll padding |
| ch015 | Example: Sticky Items | rangeExtractor |
| ch016 | Example: Infinite Scroll | loader row, fetch trigger |
| ch017 | Example: Chat | anchorTo, streaming |
| ch018 | Example: Smooth Scroll | scrollToFn |
| ch019 | Example: Table | table rows, transforms |
| ch020 | Example: Window Virtualization | window scroller, scrollMargin |