Skip to content
LIGHT DATA · FREE

VirtualList

Scroll hundreds of thousands of items smoothly.

Scroll hundreds of thousands of items smoothly. VirtualList draws only the rows in view.

Why it helps

  • Smooth with huge lists
  • Only visible rows
  • Simple

Where it fits

  • Logs
  • Catalogs
  • Selections
VirtualList control in a RayCraft page

Example

<VirtualList TItem="string" Label="Log lines" Items="_lines" @bind-SelectedItem="_selected" Height="14rem" ItemHeight="34" />
<p>Selected: @(_selected ?? "none")</p>

<VirtualList TItem="Person" Label="People with a template" Items="_people" Height="12rem" ItemHeight="44" Selectable="false">
    <ItemTemplate Context="person">
        <strong>@person.Name</strong> <span>@person.Department</span>
    </ItemTemplate>
</VirtualList>

@code {
    private readonly List<string> _lines = Enumerable.Range(1, 200000).Select(n => $"Line {n:N0}: request processed").ToList();
    private readonly List<Person> _people = Enumerable.Range(0, 5000).Select(n => SampleData.People[n % SampleData.People.Count] with { Name = $"{SampleData.People[n % SampleData.People.Count].Name} {n + 1}" }).ToList();
    private string? _selected;
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Included in RayCraft Free. Working examples are in the GitHub repository (MIT); it holds example and demo code, not the library code.

All controls ยท Documentation