| Name |
Type |
Default value |
Description |
|---|
| AlignToEnd |
bool |
false |
Pushes the items to the end (bottom, or the right in horizontal mode) of the viewport while they are too few to fill it, the way a chat conversation starts at the bottom. Pairs naturally with Reversed. |
| ChildContent |
RenderFragment<TItem>? |
null |
The custom template to render each item. |
| Classes |
BitVirtualizeClassStyles? |
null |
Custom CSS classes for different parts of the BitVirtualize. |
| Dynamic |
bool |
false |
Enables dynamic item sizing in which each rendered item gets measured in the browser and its real size gets cached, using the EstimatedItemSize for the items that have not been measured yet. |
| EmptyTemplate |
RenderFragment? |
null |
The custom template to render when there is no item available. |
| EstimatedItemSize |
float |
50 |
The assumed size in pixels of the items that have not been measured yet in dynamic mode. |
| Gap |
float |
0 |
The space in pixels between consecutive items along the scroll axis, and between the lanes of a grid. |
| FooterTemplate |
RenderFragment? |
null |
The custom template to render after the last item, inside the scroll container (for example, a loading indicator at the end of an infinite list). |
| HeaderTemplate |
RenderFragment? |
null |
The custom template to render before the first item, inside the scroll container. |
| Horizontal |
bool |
false |
Renders the items horizontally so the viewport scrolls along the x-axis. |
| IndexedItemTemplate |
RenderFragment<BitVirtualizeItemContext<TItem>>? |
null |
The custom template to render each item, which also receives the index of the item in the whole list (for example, for numbering or striping the rows). Takes precedence over ItemTemplate and ChildContent. |
| InitialIndex |
int? |
null |
The index of the item to scroll to on the first render. Ignored when Reversed is set. |
| IsStickyItem |
Func<TItem, bool>? |
null |
A predicate that marks certain items (for example, group headers) as sticky. The active sticky item gets pinned to the leading edge of the viewport while its group scrolls. Fully supported with in-memory Items; in provider mode it is applied on a best-effort basis to the currently loaded window. A change in the state the predicate reads, rather than in the predicate itself, gets applied by RefreshDataAsync. |
| Items |
ICollection<TItem>? |
null |
The in-memory collection of items to virtualize. Mutually exclusive with ItemsProvider. |
| ItemAttributes |
Func<TItem, IReadOnlyDictionary<string, object>?>? |
null |
A function that returns extra HTML attributes for the element of an item, which is the one that takes the keyboard focus: an aria-selected, aria-labelledby or aria-describedby for assistive technologies, a class or a style for the whole slot of the item. A role or an aria attribute it returns overrides the default one, while a class or a style is appended to the ones of the component. |
| ItemKey |
Func<TItem, object>? |
null |
A function that returns a stable and unique identity key for an item. When provided, rendered rows are keyed by identity (instead of by index) so per-item DOM/component state survives insertions, removals and reordering, dynamic measurements follow their item across those mutations, and the item in view stays in place when items get inserted or removed before it. |
| ItemRole |
string? |
listitem |
The ARIA role of each item element. |
| ItemSize |
float |
50 |
The size in pixels of each item (each row of items with Lanes) along the scroll axis when the Dynamic mode is off. |
| ItemsProvider |
BitVirtualizeItemsProvider<TItem>? |
null |
The item provider function that lazily supplies windows of items on demand. Mutually exclusive with Items. |
| ItemTemplate |
RenderFragment<TItem>? |
null |
Alias for ChildContent. |
| Lanes |
int |
1 |
The number of items laid side by side across the scroll axis, which turns the list into a virtualized grid: the items fill each row (each column in horizontal mode) from the start, every one as wide as an equal share of the row, and the arrow keys move across the lanes as well as along them. In dynamic mode a row is as tall as its tallest item. |
| LoadingTemplate |
RenderFragment? |
null |
The custom template to render until the component has performed its first load. |
| MinLaneSize |
float? |
null |
The smallest size in pixels of a lane across the scroll axis, which makes the grid responsive: the list has as many lanes as fit in its width (its height in horizontal mode), at least one. Takes precedence over Lanes once the list has been measured. |
| OnAtEndChanged |
EventCallback<bool> |
|
The callback to be called when the viewport arrives at the end of the list (true) or leaves it (false), for example to show a "Jump to latest" button only while the newest items are out of view. Also called with the initial state once the list has taken its initial position. The end is the one ScrollToEndAsync goes to, the FooterTemplate included; an emptied list is at both edges. |
| OnAtStartChanged |
EventCallback<bool> |
|
The callback to be called when the viewport arrives at the start of the list (true) or leaves it (false), for example to show a "Back to top" button only once the user has scrolled away. Also called with the initial state once the list has taken its initial position. The start is the one ScrollToStartAsync goes to, the HeaderTemplate included; an emptied list is at both edges. |
| OnEndReached |
EventCallback |
|
The callback to be called when the last item comes within ReachedThreshold items of the visible window, useful for appending more data in infinite scrolling scenarios. Fires once per item-count value. |
| OnStartReached |
EventCallback |
|
The callback to be called when the first item comes within ReachedThreshold items of the visible window, useful for prepending older data (for example, loading chat history when scrolling up). Fires again when items get prepended while the start is still within reach. |
| OnVisibleRangeChanged |
EventCallback<(int Start, int End)> |
|
The callback to be called whenever the visible index range changes. |
| OverscanCount |
int |
3 |
The number of extra items to render on each side of the visible window for smoother scrolling. |
| PlaceholderTemplate |
RenderFragment<BitVirtualizePlaceholderContext>? |
null |
The custom template to render an item whose data has not been loaded yet in provider mode, the first window too: before the provider tells the count of the items (and so in a prerendered or statically rendered page) the window it is first asked for is rendered as placeholders, unless a LoadingTemplate is provided. |
| ReachedThreshold |
int |
0 |
The number of items away from an edge the visible window must be before OnEndReached/OnStartReached fire. |
| Reversed |
bool |
false |
Enables the bottom-anchored mode in which the list starts scrolled to the end and automatically keeps the newest items in view when data gets appended while the user is at the bottom. Ideal for chat and log views. |
| Role |
string? |
list |
The ARIA role of the root element, which is a group instead while the loading or the empty content takes the place of the items. |
| ScrollerSelector |
string? |
null |
The CSS selector of an ancestor that scrolls the list instead of the list itself, which then grows to the full size of its items and only virtualizes them; the "window", "document", "body" and "html" values select the page itself. The list then has no height of its own to give. |
| StickyTemplate |
RenderFragment<TItem>? |
null |
The custom template to render the pinned sticky item. Falls back to the item template when not provided. |
| Styles |
BitVirtualizeClassStyles? |
null |
Custom CSS styles for different parts of the BitVirtualize. |
| Name |
Type |
Default value |
Description |
|---|
| AriaLabel |
string? |
null |
Gets or sets the accessible label for the component, used by assistive technologies. |
| Class |
string? |
null |
Gets or sets the CSS class name(s) to apply to the rendered element. |
| Dir |
BitDir? |
null |
Gets or sets the text directionality for the component's content. |
| Disabled |
bool |
false |
Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction. |
| ForceAnimation |
bool |
false |
Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. |
| HtmlAttributes |
Dictionary<string, object> |
new Dictionary<string, object>() |
Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name. |
| Id |
string? |
null |
Gets or sets the unique identifier for the component's root element. |
| Style |
string? |
null |
Gets or sets the CSS style string to apply to the rendered element. |
| TabIndex |
string? |
null |
Gets or sets the tab order index for the component when navigating with the keyboard. |
| Visibility |
BitVisibility |
BitVisibility.Visible |
Gets or sets the visibility state (visible, hidden, or collapsed) of the component. |
BitVirtualizeItemContext<TItem> properties
The context passed to the IndexedItemTemplate: an item along with its position in the whole list.
| Name |
Type |
Default value |
Description |
|---|
| Item |
TItem |
|
The item to render. |
| Index |
int |
0 |
The zero-based index of the item in the whole list (not in the rendered window). |
BitVirtualizePlaceholderContext properties
The context passed to the PlaceholderTemplate while real items are being loaded.
| Name |
Type |
Default value |
Description |
|---|
| Index |
int |
0 |
The zero-based index of the item this placeholder represents. |
| Size |
double |
0 |
The estimated size (px) reserved for the placeholder along the scroll axis. |