vue-virtualize: A Zero-Dependency Vue3 Virtual List That Keeps 100K Rows Smooth
Virtualization is the standard fix for long-list jank in admin dashboards, and vue-virtualize packages it into a type-safe, dependency-free component with features like overscan and targeted scrolling. It saves frontend developers from reimplementing a tricky pattern and highlights practical trade-offs like fixed-height limits that cover most real-world lists.
vue-virtualize is a zero-dependency Vue3 component that decouples DOM count from data size by rendering only the visible range of items plus a buffer. It uses a spacer element to simulate the full scroll height and absolute positioning to offset each item correctly. The component exposes a scrollToIndex method with start, center, and end alignment modes, and it recomputes the viewport dynamically via ResizeObserver to handle container resizing.
The library assumes fixed item heights, which covers most table, log, and stream scenarios but not dynamic-height lists like masonry or rich-text cards. Its documentation warns that using index as the key can corrupt state in interactive items, so a keyField prop lets users switch to a stable identifier. The author also notes that scroll events do not need throttling because the bottleneck is DOM count, not computation, and explains the build setup: vite for JS/CSS and vue-tsc for .d.ts to avoid a declaration-file error.
The fixed-height assumption is a deliberate trade-off that keeps the implementation simple while covering the vast majority of enterprise list scenarios.
Index-based keys are a notorious source of state corruption in virtualized lists, and the keyField prop offers a clean escape hatch without forcing a specific key scheme.
Skipping scroll throttling is a useful reminder that performance bottlenecks in this pattern are DOM-related, not computation-related, and adding throttling can introduce latency.
Rendering only the visible area is a solid move; with a hundred thousand items the DOM stays constant at a few dozen, the approach is remarkably clean. That pitfall of using index as the key causing row misalignment is pinpointed accurately.