fresh-scroll
v2.0.0
Published
🚀 Infinite scroll component for React! Zero dependencies, TypeScript ready. Perfect for social feeds, product listings, and content streams. Blazing fast performance with minimal code! 🔥
Downloads
81
Maintainers
Readme
Fresh Scroll 🚀
A zero-dependency, TypeScript-ready infinite scroll component for React. Perfect for social feeds, product listings, and content streams with blazing fast performance.
This component is headless and does not include any styling. You have full control over the component's appearance.
<FreshScroll<ContentItem>
containerProps={{
className: "flex flex-col gap-4",
}}
components={{
content: ContentCard,
loader: <div>Loading...</div>,
empty: retry => <button onClick={retry}>Retry</button>,
error: retry => <button onClick={retry}>Retry</button>,
}}
loadNext={loadNext}
/>
Features
- 🪶 Zero dependencies
- 📦 TypeScript ready
- ⚡️ Minimal and performant
- 🎯 Simple API
- 🔄 Built-in loading, error, and empty states
- ⚙️ Customizable IntersectionObserver options
Documentation
Installation
npm install fresh-scroll
or
yarn add fresh-scroll
or
pnpm add fresh-scroll
License
MIT © Daniel Bílek