v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

InfiniteScroll

Manual load-more enhanced by optional viewport observation.

Interactive preview

  • Activity record 1
  • Activity record 2
  • Activity record 3

Usage

import { InfiniteScroll } from "@devvy-ui/react";

<InfiniteScroll label="Activity feed" hasMore={hasMore} onLoadMore={loadMore}>{items}</InfiniteScroll>

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
hasMorebooleanrequiredWhether more records exist.
onLoadMore() => void or Promise<void>requiredApplication request.
loading / automaticbooleanfalseExternal busy state and optional observation.

Accessibility & behavior

Platform Behavior & Guidelines

The native load-more/retry button is always the fallback. Concurrent requests are suppressed, errors are announced, and completion after unmount does not update state. Automatic observation is opt in.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add infinite-scroll

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

InfiniteScroll.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.