| Name |
Type |
Default value |
Description |
|---|
| ChildContent |
RenderFragment<TItem>? |
null |
The custom template to render each item. |
| Classes |
BitInfiniteScrollingClassStyles? |
null |
Custom CSS classes for different parts of the component. |
| EmptyMessage |
string |
There is no item |
The message to render when there is no item available and no EmptyTemplate is provided. |
| EmptyTemplate |
RenderFragment? |
null |
The custom template to render when there is no item available. |
| EndMessage |
string? |
null |
The message to render after the last page, when there is no more item to fetch. Nothing is rendered while both this parameter and the EndTemplate are empty. |
| EndTemplate |
RenderFragment? |
null |
The custom template to render after the last page, when there is no more item to fetch. |
| ErrorMessage |
string |
Failed to load the items. |
The message to render when the items provider throws and no ErrorTemplate is provided. |
| ErrorTemplate |
RenderFragment<Exception>? |
null |
The custom template to render when the items provider throws, receiving the thrown exception as its context. It replaces the default error message and its retry button. |
| Horizontal |
bool |
false |
Lays the list out along the horizontal axis, so the pages are fetched while scrolling sideways and every scroll operation of the component works on the horizontal axis of its scroll container. The root element becomes a flex row in this mode and the sentinel element is given a width instead of a height. |
| ItemKey |
Func<TItem, object>? |
null |
The function that returns a stable key for each item, which is rendered as the @key of that item. A keyed item is matched by its key instead of by its position, so a page prepended above the rendered items inserts new nodes rather than rewriting the content of every node below it. |
| ItemsProvider |
BitInfiniteScrollingItemsProvider<TItem>? |
null |
The item provider function that will be called when scrolling ends. It receives a BitInfiniteScrollingItemsProviderRequest and returns the items of that page, optionally as a BitInfiniteScrollingItemsProviderResult that also states where the data ends. |
| ItemTemplate |
RenderFragment<TItem>? |
null |
Alias for ChildContent. |
| LastElementClass |
string? |
null |
The CSS class of the last element that triggers the loading. |
| LastElementHeight |
string? |
null |
The height of the last element that triggers the loading. |
| LastElementStyle |
string? |
null |
The CSS style of the last element that triggers the loading. |
| LastElementWidth |
string? |
null |
The width of the last element that triggers the loading, which is the size along the scroll axis in the horizontal mode. |
| LoadingMessage |
string |
Loading... |
The message to render while loading the new items and no LoadingTemplate is provided. |
| LoadingTemplate |
RenderFragment? |
null |
The custom template to render while loading the new items. |
| LoadMoreTemplate |
RenderFragment? |
null |
The custom template of the button that loads the next page in the manual mode and retries a failed load. |
| LoadMoreText |
string |
Load more |
The text of the button that loads the next page in the manual mode. The button keeps its place, disabled, while the page it asked for is loading. |
| Manual |
bool |
false |
Replaces the automatic loading with an explicit button, so each page is fetched only when the user asks for it. |
| MaxItems |
int? |
null |
The maximum number of items to load. The component stops fetching new pages as soon as the number of the loaded items reaches this value, and the last page it requests is narrowed down to what is still missing, so the list never grows beyond the cap. |
| OnEnd |
EventCallback |
|
The callback that is invoked when the last page is loaded and there is no more item to fetch. |
| OnError |
EventCallback<Exception> |
|
The callback that is invoked when the items provider throws, receiving the thrown exception. |
| OnItemsLoaded |
EventCallback<IReadOnlyList<TItem>> |
|
The callback that is invoked after each successful load, receiving the newly loaded items of that page. |
| PageSize |
int |
0 |
The number of the items to request in each page, which is sent to the items provider as the Count of its request. A provider returning fewer items than this value is considered the last page. |
| Preload |
bool |
false |
Pre-loads the data at the initialization of the component. Useful in prerendering mode. |
| ResetKey |
object? |
null |
An arbitrary value that resets the component whenever it changes: the loaded items are thrown away and the first page is fetched again from the items provider. It is what tells the component that a provider written as a lambda over a changed filter now answers differently. |
| Reversed |
bool |
false |
Prepends each loaded page before the already rendered items and moves the sentinel element to the top of the list, so scrolling up loads the older items of a chat or a log while the scroll position stays put. The list starts out scrolled to its newest items, and its root element becomes a flex column in this mode. |
| RootMargin |
string? |
null |
The rootMargin parameter of the IntersectionObserver, which grows (or shrinks) the area around the scroll viewport that the last element is checked against. |
| RetryText |
string |
Retry |
The text of the button that retries the failed load. |
| ScrollerSelector |
string? |
null |
The CSS selector of the scroll container, by default the root element of the component is selected for this purpose. The window, document, body and html values all select the viewport of the page itself. |
| Styles |
BitInfiniteScrollingClassStyles? |
null |
Custom CSS styles for different parts of the component. |
| Threshold |
decimal? |
null |
The threshold parameter for the IntersectionObserver that specifies a ratio of intersection area to total bounding box area of the last element. It defaults to 0, which fires as soon as a single pixel of the last element shows up. |
| Name |
Type |
Default value |
Description |
|---|
| Error |
Exception? |
null |
The exception of the last failed load, or null while the last load succeeded. |
| HasMore |
bool |
true |
Determines whether another page can still be fetched from the items provider. |
| IsLoading |
bool |
false |
Determines whether a page is currently being fetched from the items provider. |
| Items |
IReadOnlyList<TItem> |
|
The items loaded so far, in the order they are rendered. |
| TotalCount |
int? |
null |
The total number of the items of the data source, as it was last reported by a BitInfiniteScrollingItemsProviderResult returned from the items provider. |
| AppendItemsAsync |
Func<IEnumerable<TItem>, Task> |
|
Appends the provided items to the end of the already loaded items, without calling the items provider. |
| LoadMoreAsync |
Func<Task> |
|
Loads the next page of the items, the same way reaching the end of the list does. It is the way to load the next page in the manual mode, and to retry a failed load. |
| PrependItemsAsync |
Func<IEnumerable<TItem>, Task> |
|
Prepends the provided items to the beginning of the already loaded items, without calling the items provider. The scroll position is kept stable. |
| RemoveItemAsync |
Func<TItem, Task<bool>> |
|
Removes the first occurrence of the provided item from the loaded items, and reports whether it was found. |
| SetItemsAsync |
Func<IEnumerable<TItem>, Task> |
|
Replaces every loaded item with the provided ones, without calling the items provider. It is the way to filter, sort, deduplicate or patch the loaded items in place. |
| GetScrollOffsetAsync |
Func<Task<double>> |
|
Returns the current offset of the scroll container, in pixels, along the scroll axis of the component. |
| ScrollToOffsetAsync |
Func<double, bool, Task> |
|
Scrolls the scroll container to the provided offset, in pixels, along the scroll axis of the component. |
| RefreshDataAsync |
Func<Task> |
|
Refreshes the items and re-renders them from scratch. |
| ScrollToBottomAsync |
Func<bool, Task> |
|
Scrolls the scroll container to its bottom. Useful in the reversed (chat) mode. |
| ScrollToTopAsync |
Func<bool, Task> |
|
Scrolls the scroll container to its top. |
| 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. |
| 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. |
| Id |
string? |
null |
Gets or sets the unique identifier for the component's root element. |
| IsEnabled |
bool |
true |
Gets or sets a value indicating whether the component is enabled and can respond to user interaction. |
| 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. |