Skip to content

ListView

Defined in: ui/collection/list-view.ts:73

Virtualized list driver. Owns a ViewPool + DataSource subscription; on each update() computes the visible index range and syncs the mounted item set to match.

Does not own input — callers drive scrolling by calling setScrollOffset(). Typical wiring: a ScrollContainer primitive (or the app’s input layer) computes a new offset and pushes it in.

T = unknown

new ListView<T>(opts): ListView<T>

Defined in: ui/collection/list-view.ts:90

ListViewOptions<T>

ListView<T>

dispose(): void

Defined in: ui/collection/list-view.ts:221

Release all mounted items and tear down subscriptions.

void


getContentSize(): Vec2

Defined in: ui/collection/list-view.ts:131

Total size of the content for the current data count.

Vec2


getMountedCount(): number

Defined in: ui/collection/list-view.ts:141

Number of entities currently mounted (useful for virtualization tests).

number


getViewport(): Rect

Defined in: ui/collection/list-view.ts:121

Current visible window within the content, in content-local coords.

Rect


getVisibleRange(): [number, number]

Defined in: ui/collection/list-view.ts:136

Strict visible index range [start, end).

[number, number]


refresh(): void

Defined in: ui/collection/list-view.ts:159

Mark the mount set dirty — the next update() will re-sync.

void


setScrollOffset(offset): void

Defined in: ui/collection/list-view.ts:145

Vec2

void


setViewportSize(size): void

Defined in: ui/collection/list-view.ts:151

Vec2

void


update(): void

Defined in: ui/collection/list-view.ts:167

Sync mounted items to the current viewport + data source. Cheap when nothing has changed (short-circuits on !dirty).

void