VirtualListView
Variable heights with a stable visible window.
Virtualization
Many rows should still feel light
Only the visible range is mounted while measured row heights keep the complete scroll surface accurate.
1,000
records in the local showcase
44–120 px
measured variable row heights
Header
custom content in the same scroll flow
Scrolling header with a long list
Short, medium and tall rows update the prefix-height model as they enter the viewport.
Range
Only visible children count
Foreach owns stable insertion points for the current viewport and overscan window.
Heights
Measurement corrects estimation
A prefix sum maps scroll offsets to indices even when every row has a different height.
Lifecycle
Observers leave with their cells
Resize, scroll and remote listeners are disposed by their owning components.
VirtualList DSL
The row renderer and optional header remain inside the contextual component tree.
scala
virtualList[ShowcaseItem](showcaseItems) {
estimateHeightPx = 64
overscanPx = 240
crawlable = true
crawlId = "showcase-records"
cellRenderer = (item: ShowcaseItem | Null, index: Int) =>
div { text(item.title) {} }
header {
div { text("Scrolling list header") {} }
}
}
Crawl state
VirtualListView uses the same component-local cookie contract as TableView and DataGrid.
text
crawlable = true
crawlId = "showcase-records"
Cookie: ui-crawl-showcase-records
State: offset, limit and optional remote sorting
URL: remains unchanged