virtualize Module

Functions to create Virtualize components.

Functions and values

Function or value Description

comp

Full Usage: comp

Returns: VirtualizeBuilder<'item>
Modifiers: inline
Type parameters: 'item

Computation expression builder to create a Virtualize component.

The contents of the computation expression should be: 1. component parameters, if any; 2. let! to bind the current item to M:items or M:itemsProvider; 3. the body of an item.

Returns: VirtualizeBuilder<'item>
Example

 virtualize.comp {
     virtualize.itemSize 30
     let! item = virtualize.items (seq { 1 .. 1000 })
     div {
         $"Item number {item}"
     }
 }
Multiple items
val seq: sequence: seq<'T> -> seq<'T>

--------------------
type seq<'T> = System.Collections.Generic.IEnumerable<'T>

itemSize v

Full Usage: itemSize v

Parameters:
    v : single - The height of an item.

Returns: Attr
Modifiers: inline

A component parameter indicating the height of an item in CSS points.

v : single

The height of an item.

Returns: Attr

items items

Full Usage: items items

Parameters:
Returns: VirtualizeItemsDeclaration<'item>
Modifiers: inline
Type parameters: 'item

Pass a direct collection of items to a Virtualize component.

items : IReadOnlyCollection<'item>

The collection of items.

Returns: VirtualizeItemsDeclaration<'item>
Example

 virtualize.comp {
     let! item = virtualize.items (seq { 1 .. 1000 })
     div { $"Item number {item}" }
 }
Multiple items
val seq: sequence: seq<'T> -> seq<'T>

--------------------
type seq<'T> = System.Collections.Generic.IEnumerable<'T>

itemsProvider itemsProvider

Full Usage: itemsProvider itemsProvider

Parameters:
Returns: VirtualizeItemsDeclaration<'item>
Modifiers: inline
Type parameters: 'item

Generate the items of a Virtualize component on the fly.

itemsProvider : ItemsProviderRequest -> ValueTask<ItemsProviderResult<'item>>

The function that generates items on the fly.

Returns: VirtualizeItemsDeclaration<'item>
Example

 virtualize.comp {
     let! item = virtualize.itemsProvider <| fun request ->
         ValueTask(task {
             let items = seq { request.StartIndex .. request.StartIndex + request.Count - 1 }
             return ItemsProviderResult(items, 1000)
         })
     div { $"Item number {item}" }
 }
val task: TaskBuilder
Multiple items
val seq: sequence: seq<'T> -> seq<'T>

--------------------
type seq<'T> = System.Collections.Generic.IEnumerable<'T>

overscanCount v

Full Usage: overscanCount v

Parameters:
    v : int - The number of extra items to load.

Returns: Attr
Modifiers: inline

A component parameter indicating the number of extra items to load for smooth scrolling.

v : int

The number of extra items to load.

Returns: Attr

placeholder v

Full Usage: placeholder v

Parameters:
Returns: Attr
Modifiers: inline

A component parameter indicating the placeholder content shown while an item is loading.

v : PlaceholderContext -> Node

The placeholder content.

Returns: Attr