virtualRange()
function virtualRange(
model,
renderItem,
getItemKey?): DirectiveResult;Render only the current model range and subscribe to range changes.
Parameters
model
renderItem
getItemKey?
VirtualRangeGetItemKey = getIndexItemKey
Returns
DirectiveResult
Related examples
- HorizontallitThis example virtualizes a horizontal collection: columns are measured and positioned along the x-axis while the browser keeps a native horizontal scrollbar.
- Simple ListlitThis is the smallest complete virtual list for each framework. Application data stays in the framework while the adapter renders and measures only the current visible range.
- Sticky Header And FooterlitThis example keeps a header and footer inside the scrolling viewport while the virtual item range remains measured and independently positioned.
- Variable SizelitThis example renders rows whose heights differ and can change after mount. Mounted items report their real border-box size, replacing the initial estimate without requiring application-side layout reads.
- Nested ContainerlitThis example separates the native scroll owner from the element that contains the virtual range. Content can appear before the list while core still measures the nested offset and publishes the correct geometry.
- Live FeedlitThis example appends variable-height messages while demonstrating end-anchor behavior: a reader at the end stays at the newest message, while a reader who scrolled upward keeps the current viewport.