InfiniteScroll

Loads the next page when the end of a list scrolls into view

Category: feedback · WCAG 2.2-AA · feedback, infinite-scroll, pagination, list, scroll, mobile, lazy

States

Props

PropTypeDefaultDescription
onLoadMore() => Promise<unknown> | unknownCalled when the sentinel comes into view, or the button is activated; the spinner shows until it settles
disabledbooleanfalseWhen true, stops observing and renders nothing — there are no more pages.
rootMarginstring'200px'How far ahead of the end to start loading, as an IntersectionObserver root margin.
labels{ loadMore?: string; loading?: string }Overrides for the component’s user-visible strings (i18n).
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

How to build an accessible InfiniteScroll in React →

Examples

Basic

Place it as the last child of the scrolling region, after the list.

<InfiniteScroll onLoadMore={loadNextPage} />

Stopping at the last page

Renders nothing and stops observing once there is nothing left to load.

<InfiniteScroll onLoadMore={loadNextPage} disabled={!hasMore} />

Loading earlier

Starts the next page well before the user reaches the end.

<InfiniteScroll onLoadMore={loadNextPage} rootMargin="600px" />

Related components

← Back to docs