Table of Contents

Class VirtualListNode

Namespace
Velvet
Assembly
Velvet.Docs.dll

List virtualization node for large item collections. Renders a ScrollView of items and keeps only the items in view present in the DOM to ensure performance.

public sealed class VirtualListNode : VNode
Inheritance
object
VirtualListNode
Inherited Members

Constructors

VirtualListNode(IReadOnlyList<object?>, Func<object?, string>, Func<int, float>, Func<object?, VNode>, int)

Creates a virtualized list whose items each take the height itemHeight gives for their index. Prefer the VirtualList<T>(IReadOnlyList<T>, Func<T, string>, Func<int, float>, Func<T, VNode>, bool, int, string?, string?, string?, Ref<VirtualListHandle>?, FiberEventBinding[]?) factory; this is the type-erased form it builds.

VirtualListNode(IReadOnlyList<object?>, Func<object?, string>, float, Func<object?, VNode>, int)

Creates a virtualized list of items of one height. Prefer the VirtualList<T>(IReadOnlyList<T>, Func<T, string>, float, Func<T, VNode>, bool, int, string?, string?, string?, Ref<VirtualListHandle>?, FiberEventBinding[]?) factory; this is the type-erased form it builds.

Properties

ClassNames

Array of USS class names applied to the ScrollView.

Events

Event bindings applied to the list's ScrollView.

Horizontal

Whether the items lie in a row the list scrolls sideways, each ItemHeight wide.

ItemHeight

Height (px) of every item, or 0 where ItemHeightAt gives each item its own.

ItemHeightAt

Height (px) of the item at an index, or null where every item is ItemHeight tall.

Items

Item list (type-erased; an element is nullable because the source element type may be).

KeySelector

Function that returns a unique key for each item.

ListRef

The ref that holds the list's VirtualListHandle while the list is mounted.

Name

ScrollView.name (for USS #selector).

Overscan

Number of extra items to render outside the visible range.

Renderer

Function that produces a VNode from each item.