🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

BlazorInfiniteScroll

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

BlazorInfiniteScroll

A Blazor infinite scroll component.

1.0.2
NuGet
Version published
Maintainers
1
Created
Source

Blazor Infinite Scroll

Blazor Infinite Scroll is a Blazor component that provides an easy-to-use infinite scroll functionality. It triggers events when the user scrolls to the end of a content container, allowing you to load more content dynamically.

Features

  • Supports infinite scrolling for any Blazor component.
  • Allows you to define when to trigger loading more data.
  • Built-in support for scroll detection using IntersectionObserver and scroll events.
  • Easy integration into your Blazor application.

Installation

To install the Blazor Infinite Scroll package, follow these steps:

  • Install the NuGet Package

    You can add the package to your Blazor project by running the following command in your project directory:

    dotnet add package BlazorInfiniteScroll
    
    
  • Usage

@* Example with normal list of items *@
<InfiniteScroll 
    ClassName="custom-scroll" 
    Style="height:400px;" 
    ObserverId="observer1" 
    ScrollBoxId="scrollBox1" 
    HasAnythingExistToLoadMore="true" 
    IsLoadingMore="false" 
    IsInfiniteLoadingNeeded="true" 
    OnEndReached="HandleEndReached">
      @foreach(var item in YourList){
    
      }
    <div id="observer1"></div>
</InfiniteScroll>

@* Example with virtualized list of items *@
<InfiniteScroll 
    ClassName="custom-scroll" 
    Style="height:400px;" 
    ObserverId="observer2" 
    ScrollBoxId="scrollBox2" 
    HasAnythingExistToLoadMore="true" 
    IsLoadingMore="false" 
    IsInfiniteLoadingNeeded="true" 
    OnEndReached="HandleEndReached">
   <Virtualize Items="YourList" Context="item">

   </Virtualize>
   <div id="observer2"></div>
</InfiniteScroll>
@code {
    private async Task HandleEndReached(bool isVisible)
    {
        if (isVisible)
        {
            // Load more content
        }
    }
}

Keywords

blazor

FAQs

Package last updated on 15 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts