Virtual Scroll

A high-performance virtualization library for Vue 3.

Documentation

Everything you need to know about integrating @pdanpdan/virtual-scroll into your Vue 3 applications. From basic list virtualization to advanced grid and SSR setups.

Configurator / Code Generator

Select the features you need and generate complete typed Vue code - component, composables, or a CodePen.

Comparison with Alternatives

How this library stacks up against other Vue 3 virtualization solutions.

Essentials
Essential

Vertical Fixed

Optimized for lists where every item has the same height.

Essential

Vertical Dynamic

Handles variable item heights automatically using ResizeObserver.

Essential

Vertical Fixed Body

Use the browser window as the primary scroll container.

Essential

Vertical Dynamic Body

Native window scrolling with variable item heights.

Essential

Horizontal Fixed

Full support for horizontal-only virtualization with fixed widths.

Essential

Horizontal Dynamic

Horizontal scrolling with variable, measured item widths.

Essential

Grid Fixed

Scroll simultaneously in both X and Y axes with virtualized columns.

Essential

Grid Dynamic

Bidirectional scroll with programmatic column widths using a function.

Essential

Flow Table

Virtualized rows in a real flow table with dynamic heights and column-width modes.

Essential

Masonry Grid

Real masonry in one VirtualScrollMasonry container: responsive columns, canonical oracle heights and anchored reflow.

Features
Feature

Infinite Scroll

Automatic pagination and loading states when reaching end of content.

Feature

Scroll Restoration

Maintain scroll position seamlessly when items are prepended.

Feature

Sticky Sections

iOS-style pushing headers for segmented lists and grouped items.

Feature

SSR Support

Demonstrates pre-rendering and auto-scrolling to a specific range for SSR.

Feature

Custom Scrollbar

Replace native scrollbars with highly customizable virtual ones.

Feature

Independent Scrollbars

Use VirtualScrollbar components standalone to control any scrollable element.

Feature

Scroll Snapping

Automatically align to the nearest item after scrolling stops.

Patterns & Recipes
Pattern

Chat Interface

Chat with dynamic heights, an initial scroll to bottom, and history restoration when older messages are prepended.

Pattern

Blog Posts

Blog feed with dynamic heights and on-demand post loading.

Pattern

Async Content

Virtualized feed whose rows fetch simulated content on demand, with a shared cache and auto-measured heights.

Pattern

Live Streaming

A simulated market feed that mutates only the visible window of 5,000 virtualized symbols.

Pattern

Table

Semantic HTML table virtualization for accessible tabular data grids.

Pattern

Spreadsheet

Excel-like bidirectional grid with sticky row and column headers and resizable cells.

Pattern

Data Browser

Grouped directory pattern with iOS-style sticky section headers, instant search over a rebuilt section index and jump-to navigation.

Pattern

Code Viewer

Browse and search the real simdutf source file used in the code diff example.

Pattern

Log Viewer

Filter and search 200,000 lazy generated log lines with virtualization.

Pattern

Side-by-Side Code Diff

Synced side-by-side virtualized diff of two code versions with search and highlighted changes.

Pattern

Search & Highlight

Data-layer search over virtualized content with the CSS Custom Highlight API (Ctrl+K).

Pattern

Collapsible Tree

Hierarchical list where items can be expanded or collapsed while maintaining smooth performance.

Pattern

Draggable List

Reorder virtualized items using native drag and drop while maintaining high performance.

Pattern

Photo Gallery

High-performance grid photo gallery with loading placeholders for images as rows stream in.

Pattern

Masonry Gallery

Remote images in a single masonry container: aspect-ratio oracle heights and bounded low-priority prefetch.