svelte-infinite-scroll Svelte Themes

Svelte Infinite Scroll

Example implementation of infinite scrolling with SvelteKit and TypeScript, using dummy data from live APIs.

svelte-infinite-scroll

Simple infinite scrolling implementation built using SvelteKit and TypeScript.

Approach

Pretty simple approach inspired by this snippet. Creates an event listener on a component-level, and when the scroll is detected as at it's end, calls a function passed from parent to load more data. The parent is expected to then send back loaded data to the binded list.

TODO

This was just an exercise for myself, but I published it as I can see others may benefit from seeing the snippet in action with real-world data. As such, I don't forsee much more work being done on this. I may spin up a demo site, or add a loading skeleton feature since that would be a bit more production-like.

Top categories

Loading Svelte Themes