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.

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.

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.

Patterns & Recipes
Pattern

Chat Interface

Smooth auto-scrolling, history loading, and dynamic message heights.

Pattern

Table

Semantic HTML <table> virtualization for accessible data grids.

Pattern

Spreadsheet

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

Pattern

Collapsible Tree

Virtualized hierarchical list with expandable/collapsible nodes.

Pattern

Draggable List

Reorder virtualized items using native drag and drop.

Pattern

Photo Gallery

Lazy-loaded image grid with bidirectional virtualization.

Pattern

Masonry Grid

Achieve masonry layout by combining multiple columns.

Pattern

Search & Highlight

Implement high-performance search across thousands of virtualized items.