New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-infinite-gallery

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-infinite-gallery

A beautiful infinite wraparound gallery React component.

latest
Source
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

Infinite Gallery

A beautiful infinite wraparound gallery React component that supports both images and videos with smooth animations and interactions.

Live Demo 🚀

Check out the live demo to see the component in action!

Installation 📦

npm install react-infinite-gallery

Or:

yarn add react-infinite-gallery

Features ✨

  • 🔄 Infinite scrolling with smooth loading
  • 📱 Fully responsive grid layout
  • 🎯 Lazy loading of images for better performance
  • ⚙️ Highly customizable grid settings
  • 🎨 Clean and modern design
  • 🚀 Lightweight and optimized for performance
  • 🎨 Clean and modern design
  • 🚀 Lightweight and optimized for performance

Usage 💻

import React from 'react';
import InfiniteGallery from 'react-infinite-gallery';
import 'react-infinite-gallery/dist/InfiniteGallery.css';

const itemsData = [
  { 
    id: 1, 
    type: 'image', 
    content: 'https://example.com/image1.jpg',
    badgeText: 'Sample',
    color: '#EF5350',  // Optional: custom color
    rotation: 2,       // Optional: custom rotation
    scale: 1.1         // Optional: custom scale
  },
  { 
    id: 2, 
    type: 'video', 
    content: 'https://example.com/video1.mp4',
    badgeText: 'Video',
    color: '#42A5F5'   // Optional: custom color
  },
  // Add more items as needed
];

function App() {
  return (
    <InfiniteGallery
      itemsData={itemsData}
      cardWidth={280}
      cardHeight={380}
      headerContent={<h1>Infinite Gallery</h1>}
      footerContent={<p>Gallery Footer</p>}
      galleryAnimate={true}
      badgeClass="custom-badge"
      stackInDuration={1500}
      stackOutDuration={1000}
      playButtonProps={{
        className: 'custom-play-btn',
        style: { backgroundColor: 'rgba(0,0,0,0.5)' },
        children: '▶'
      }}
      expandButtonProps={{
        className: 'custom-expand-btn',
        style: { backgroundColor: 'rgba(0,0,0,0.5)' }
      }}
      infoButton={<button>ℹ️</button>}
    />
  );
}

Props 🔧

PropTypeDefaultDescription
itemsDataArray[]Array of items to display. Each item should have: id, type ('image' or 'video'), content (URL), and optional badgeText, color, rotation, and scale
cardWidthnumber280Width of each card in pixels
cardHeightnumber380Height of each card in pixels
headerContentReactNodenullContent to display at the top of the gallery
footerContentReactNodenullContent to display at the bottom of the gallery
galleryAnimatebooleantrueWhether to show the initial animation
badgeClassstring''Custom CSS class for badges
stackInDurationnumber1500Duration of stack-in animation in milliseconds
stackOutDurationnumber1000Duration of stack-out animation in milliseconds
playButtonPropsobject{}Props for customizing the video play button
expandButtonPropsobject{}Props for customizing the expand button
infoButtonReactNodenullCustom info button component

Item Data Structure

Each item in the itemsData array should have the following structure:

interface GalleryItem {
  id: number | string;          // Unique identifier
  type: 'image' | 'video';      // Type of content
  content: string;              // URL of the content
  badgeText?: string;           // Optional badge text
  color?: string;               // Optional custom color
  rotation?: number;            // Optional rotation in degrees
  scale?: number;               // Optional scale factor
}

CSS Customization

The component comes with default styles but can be customized using CSS classes:

  • .ig-gallery - Main gallery container
  • .ig-card - Individual card container
  • .ig-badge - Badge element
  • .ig-play-btn - Video play button
  • .ig-expand-btn - Expand button
  • .ig-info-panel - Info panel

Important Notes ⚠️

  • A minimum of 20 images is required for optimal performance and user experience
  • Supported image formats: jpg, png, webp
  • For best performance, use appropriately sized and optimized images
  • Make sure to import the CSS file as shown in the usage example

Example

Check out the usage-example.jsx file in the repository for a complete implementation example.

License 📄

MIT

Keywords

react

FAQs

Package last updated on 17 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts