Skip to content

Virtual

@sectile/virtual lays out large surfaces whose item sizes and order keep changing. Once an element renders, its browser size updates coordinates from the changed point onward. Inserts, removals, and moves before the viewport also preserve the screen position of the item currently being read.

Install

The command follows the Usage environment selected in the top navigation.

Vue
pnpm add vue @sectile/vue @sectile/virtual

Variable-height list

This list contains 50,000 rows with different heights. Sectile creates only the rows around the viewport and automatically applies their actual DOM sizes. The code tab shows only the implementation for the selected Usage environment.

Overscan120 px
00002
Review payment recordsReview

Content can wrap across lines without an application-owned height calculator.

Changes before the viewport preserve the item currently being read.

ROW 00002 · Payments team
00003
Sync documentsComplete

Changes before the viewport preserve the item currently being read.

Measured content updates the position of every item that follows it.

Content can wrap across lines without an application-owned height calculator.

ROW 00003 · Docs team
00004
Update access policyRunning

Measured content updates the position of every item that follows it.

ROW 00004 · Platform team
00005
Refresh search indexReview

Content can wrap across lines without an application-owned height calculator.

Changes before the viewport preserve the item currently being read.

ROW 00005 · Search team

What Sectile handles

  • Real element sizes: rendered elements can supply their dimensions without a fixed height or an application-owned sizing function.
  • Incremental layout: changing one size updates coordinates from the affected range.
  • Anchored scrolling: collection and size changes preserve the viewport position of the current anchor.
  • Large two-dimensional surfaces: lists, track grids, masonry, and spatial layouts share the same query and measurement flow.

Choose a layout

SurfaceLayoutRead more
One ordered axisLinearLinear lists
Many rows and many columnsTrack gridGrid, masonry, and spatial
Variable-height cardsMasonryGrid, masonry, and spatial
Application-positioned canvasSpatialGrid, masonry, and spatial

Continue

Released under the MIT License.