svelte-infinite-loading
An infinite scroll component for Svelte, to help you implement an infinite scroll list more easily.
svelte-infinite-loading adds infinite scroll to Svelte apps
An infinite scroll component for Svelte that helps developers build lists which load more content as the user scrolls.
What it does
svelte-infinite-loading is an infinite scroll component for Svelte applications. Its job is to make it easier to implement a list that loads more items as the user scrolls, a pattern common in feeds, search results, and timelines. The author states it is heavily inspired by vue-infinite-loading and reuses most of that project's code and functionality, which is a practical way to bring a familiar API to Svelte developers who may have used the Vue original. The listed features are small but cover the usual needs. It is mobile friendly, so touch scrolling triggers loads as expected. It ships built in spinners, so you do not have to design a loading indicator from scratch. It supports two directional loading, meaning content can be fetched when the user reaches either end of the list rather than only the bottom. And it displays a load result message, which lets the UI tell the user when there is no more data or when a load failed. The README keeps the description tight and does not promise extras the component does not have. For a Svelte project that just needs scroll based pagination without pulling in a larger UI kit, a focused component like this is a reasonable fit, and the MIT license keeps it usable in commercial and open source work alike.
Installation and usage
Installing the component follows the normal package manager routes. The README shows npm install svelte-infinite-loading, yarn add svelte-infinite-loading, and pnpm install svelte-infinite-loading, with pnpm noted as the recommended option. For projects that do not use a bundler, the component is also available from a CDN through unpkg, in both a UMD build and an ES module build. There is one Svelte specific caveat called out: if you use the component inside a Sapper application, you should install it as a dev dependency, and the README links to the Sapper template notes explaining why. That detail matters because Sapper's server side rendering can mishandle client only components if they end up in the wrong dependency set. Beyond installation, the README points to a set of live examples and to a documentation wiki for full usage. The examples are Svelte REPL links, which let a developer open a working playground in the browser and tweak it. The CDN option means a quick prototype can pull the component straight into an HTML page without a build step at all, which lowers the barrier for trying it out before committing to a project dependency. The dev dependency note for Sapper is the kind of small trap that wastes an afternoon if missed. Calling it out in the README lets a Svelte user avoid a server side rendering error and keeps the component in the right part of the build from the start.
Examples and docs
The README links four example playgrounds built on the Svelte REPL, all centered on a Hacker News style feed. The first is a plain Hacker News demo. The second adds a filter so you can see how the component behaves when the underlying query changes. The third shows the top direction, demonstrating that two way loading is not just a feature bullet but something you can watch work. The fourth combines the component with svelte-tiny-virtual-list, which is a useful pattern because infinite scroll and windowing solve adjacent problems: one fetches more data, the other keeps the DOM small once there are thousands of rows. Pointing to that combination tells developers how the component fits into a larger performance story rather than standing alone. For documentation, the README sends readers to the repository wiki, which holds the fuller reference for props, events, and slots. The project keeps its written docs outside the README itself, which is a common choice for small component libraries where the README serves as a landing page. Between the REPL examples and the wiki, a new user has both a copy paste starting point and a detailed reference without the README growing long. The REPL links are useful because they run in the browser with no install, so a skeptic can confirm the behavior in a minute. Pairing that with the wiki means the same page serves both a quick look and a deep reference, which suits developers at different stages of a project.
Editorial conclusion
The component is distributed under the MIT license and installable from npm as svelte-infinite-loading.
Community notes