DS0
Components

InfiniteScroll

A scroll-triggered pagination component using IntersectionObserver.

Overview

InfiniteScroll automatically loads more content when the user scrolls near the bottom of the list. Uses IntersectionObserver for performant scroll detection.

Usage

<InfiniteScroll
  hasMore={hasMore}
  loadMore={fetchNextPage}
  loader={<Spinner />}
>
  {items.map(item => <Card key={item.id}>{item.name}</Card>)}
</InfiniteScroll>

API Reference

PropTypeDefaultDescription
hasMorebooleantrueWhether more content exists
loadMore() => voidLoad more callback
loaderReactNodeSpinnerLoading indicator
thresholdnumber0.8IntersectionObserver threshold
childrenReactNodeScrollable content
ComponentWhen to Use Instead
VirtualizedListFixed-size windowed rendering
PaginationManual page navigation

On this page