createVirtual()
function createVirtual(params): VirtualScroller;Create a Solid-owned VirtualScroller and synchronize reactive parameters.
Parameters
params
MaybeAccessor<VirtualScrollerInitialParams>
Returns
Example
const model = createVirtual(() => ({
itemCount: count(),
estimatedItemSize: 40
}));Related examples
- HorizontalsolidThis example virtualizes a horizontal collection: columns are measured and positioned along the x-axis while the browser keeps a native horizontal scrollbar.
- Simple ListsolidThis 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.
- Simple PrimitivessolidThis example builds a list from the adapter's lower-level model, layout, range, and item primitives instead of its high-level list binding.
- Sticky Header And FootersolidThis example keeps a header and footer inside the scrolling viewport while the virtual item range remains measured and independently positioned.
- Variable SizesolidThis 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.
- GridsolidThis example combines one vertical model and one horizontal model to virtualize a dynamic two-dimensional grid.