π Responsive, Animated, Aesthetic Infinite Image Feed for React
β¨ Smooth scroll Β· π¨ Multiple Themes Β· π‘ Customizable Β· β‘ Production Ready
@darshitachaurasia β¨π‘πΈ π οΈ Helped fix build errors and improved test workflow. |
npm install react-infinite-feed-gallery
# or
yarn add react-infinite-feed-galleryimport { FeedScroll } from 'react-infinite-feed-gallery';
import 'react-infinite-feed-gallery/styles';
const images = [
{
url: 'https://example.com/image1.jpg',
alt: 'Beautiful landscape',
likes: 1234,
views: 5678,
shares: 90
},
// ... more images
];
function App() {
return (
<FeedScroll
images={images}
layout="masonry"
theme="glass"
onReachEnd={() => console.log('Reached end!')}
/>
);
}import { FeedScroll } from 'react-infinite-feed-gallery';
const MyGallery = () => {
const images = [
{
url: 'https://picsum.photos/400/300?random=1',
alt: 'Random image 1',
likes: 123,
views: 456,
shares: 7
},
// ... more images
];
return (
<FeedScroll
images={images}
layout="grid"
theme="light"
/>
);
};import { FeedScroll } from 'react-infinite-feed-gallery';
const AdvancedGallery = () => {
const handleImageClick = (image, index) => {
console.log('Clicked image:', image, 'at index:', index);
};
const handlePinImage = (image) => {
console.log('Pinned image:', image);
};
const handleReachEnd = () => {
// Load more images from API
console.log('Reached end, loading more...');
};
return (
<FeedScroll
images={images}
layout="masonry"
theme="vintage"
showStats={true}
enablePin={true}
enableComments={true}
onImageClick={handleImageClick}
onPinImage={handlePinImage}
onReachEnd={handleReachEnd}
pageSize={12}
autoLoad={true}
/>
);
};import { FeedScroll } from 'react-infinite-feed-gallery';
const DarkGallery = () => {
return (
<FeedScroll
images={images}
layout="fullwidth"
theme="dark"
className="custom-gallery"
threshold={0.2}
showStats={false}
/>
);
};| π§© Prop | π Type | π§· Default | π Description |
|---|---|---|---|
images |
ImageItem[] |
Required | Array of image objects |
layout |
'grid' | 'masonry' | 'fullwidth' |
'grid' |
Layout type for gallery |
theme |
'light' | 'dark' | 'vintage' | 'glass' |
'light' |
Visual theme of the feed |
loading |
boolean |
false |
Show loading state |
className |
string |
'' |
Custom CSS classes |
threshold |
number |
0.1 |
Intersection observer threshold |
pageSize |
number |
12 |
Images per page |
autoLoad |
boolean |
true |
Auto-load images on scroll |
showStats |
boolean |
true |
Show image stats overlay |
enablePin |
boolean |
true |
Enable pin/save feature |
enableComments |
boolean |
false |
Enable comments below images |
onReachEnd |
() => void |
β | Callback when feed ends |
onImageClick |
(image, index) => void |
β | Callback on image click |
onPinImage |
(image) => void |
β | Handler when pin is clicked |
onLikeImage |
(image, index) => void |
β | Handler when like is clicked |
interface ImageItem {
url: string; // Image URL (required)
alt?: string; // Alt text for accessibility
likes?: number; // Number of likes
views?: number; // Number of views
shares?: number; // Number of shares
id?: string; // Unique identifier
title?: string; // Image title
description?: string; // Image description
}/* Override default styles */
.feed-scroll-container {
background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
}
.image-card {
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}import { motion } from 'framer-motion';
// Custom animation variants
const customVariants = {
hidden: { opacity: 0, y: 100 },
visible: { opacity: 1, y: 0 }
};- Optimize Images: Use WebP format and appropriate sizes
- Lazy Loading: Images load automatically when in viewport
- Virtual Scrolling: Only render visible images
- Debounced Scroll: Prevents excessive API calls
Users can pin images to a local "board" stored in localStorage:
const handlePinImage = (image) => {
// Image is automatically saved to localStorage
console.log('Image pinned:', image);
};GIF images automatically get special effects:
- Pulsing glow animation
- GIF indicator badge
- Enhanced hover effects
Enable trending comments on hover:
<FeedScroll
enableComments={true}
// Comments will appear on hover
/>npm installnpm run devnpm run buildnpm run type-checknpm run lintMIT License - see LICENSE file for details.
We welcome contributions from the community! If you have ideas, improvements, or bug fixes, follow the steps below to make your contribution count π
-
π΄ Fork the repository
-
πΏ Create a branch for your feature or fix
git checkout -b feature/your-amazing-feature
-
πΎ Commit your changes with a clear message
git commit -m "β¨ Add your amazing feature" -
π Push to your forked repo
git push origin feature/your-amazing-feature
-
π¬ Open a Pull Request and describe what youβve done
- Write clear, concise commit messages
- Keep your changes focused on one feature/fix
- Follow existing code style and naming conventions
- If applicable, update documentation and tests
- π§ Email: kaleakshay8856@gmail.com
- Virtual scrolling for large datasets
- Image zoom on click
- Social sharing integration
- Advanced filtering options
- Custom animation presets
- Server-side rendering support
- Progressive Web App features
Made with β€οΈ by Dev-axay18






.png?raw=true)

