Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Tanstack Virtual

  • 102 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

tanstack-virtual is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • tanstack-virtual
  • AI & Agent Building
  • AI-coding skill

Tanstack Virtual by the numbers

  • 102 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #4,307 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill tanstack-virtual

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs102
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

TanStack Virtual

Overview

TanStack Virtual is a headless UI utility for virtualizing large lists, grids, and tables. It renders only the visible items in the viewport, dramatically reducing DOM nodes and improving performance for datasets with thousands of rows. Framework adapters are available for React, Vue, Solid, Svelte, Lit, and Angular.

When to use: Rendering thousands of rows or columns, building virtualized tables, implementing infinite scroll, displaying large datasets where DOM node count impacts performance.

When NOT to use: Small lists under ~100 items (no performance benefit), server-rendered static content, layouts where all items must be in the DOM for SEO or accessibility, simple pagination (render one page at a time instead).

Quick Reference

PatternAPIKey Points
Vertical listuseVirtualizer({ count, getScrollElement, estimateSize })Wrap items in absolute-positioned container
Horizontal listuseVirtualizer({ horizontal: true, ... })Use getTotalSize() for width instead of height
Grid layoutRow virtualizer + column virtualizerTwo virtualizer instances sharing one scroll element
Dynamic sizingref={virtualizer.measureElement}Set data-index on each element
Window scrolleruseWindowVirtualizer({ count, estimateSize })No getScrollElement needed
Scroll to itemvirtualizer.scrollToIndex(index)Supports `align: 'start' \
Scroll to offsetvirtualizer.scrollToOffset(px)Supports align and behavior: 'smooth'
Custom keysgetItemKey: (index) => items[index].idStable keys improve measurement cache
Overscanoverscan: 5Renders extra items outside viewport (default: 1)
Gap between itemsgap: 8Space between virtualized items in pixels
Multi-lane layoutlanes: 3Masonry-style column layouts
PaddingpaddingStart: 100, paddingEnd: 100Space before first and after last item
RTL supportisRtl: trueRight-to-left horizontal scrolling
Range extractorrangeExtractor: (range) => [...]Customize rendered indices (sticky headers, footers)
Disable virtualizerenabled: falseRenders nothing, resets internal state
Force remeasurevirtualizer.measure()Call after external layout changes

Common Mistakes

MistakeCorrect Pattern
Missing overflow: auto on scroll containerParent element must have overflow: auto and a fixed height/width
Using virtualItem.index as React keyUse virtualItem.key which accounts for dynamic reordering
Forgetting position: relative on inner containerThe total-size container must be position: relative
Not setting data-index with measureElementDynamic measurement requires data-index={virtualItem.index} on each element
Setting estimateSize too small for dynamic itemsOverestimate to prevent scroll jumping; use largest expected size
Recreating getScrollElement on every renderUse a ref callback: () => parentRef.current
Not using getTotalSize() for container dimensionsInner container height/width must equal virtualizer.getTotalSize()
Absolute positioning without transformUse transform: translateY(item.start) for GPU-accelerated positioning
Using contain: strict without fixed dimensionscontain: strict requires explicit width and height on the scroll container
Using with React Compiler without opting outAdd 'use no memo' directive to components using useVirtualizer — interior mutability breaks memoization

Delegation

If the tanstack-table skill is available, delegate data table virtualization to it. TanStack Table has built-in virtualization integration.
Otherwise, recommend: npx skills add oakoss/agent-skills --skill tanstack-table

>

If the tanstack-query skill is available, delegate data fetching and infinite query patterns to it.
Otherwise, recommend: npx skills add oakoss/agent-skills --skill tanstack-query

References

  • List virtualization with useVirtualizer
  • Grid virtualization with row and column virtualizers
  • Dynamic sizing with measureElement
  • Infinite scroll with TanStack Query integration

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.