Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-image-gallery

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-gallery

React carousel image gallery component with thumbnail and mobile support

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
155K
decreased by-14.32%
Maintainers
1
Weekly downloads
 
Created

What is react-image-gallery?

react-image-gallery is a flexible and customizable image gallery component for React applications. It allows developers to create responsive and interactive image galleries with features like slide shows, thumbnails, and full-screen mode.

What are react-image-gallery's main functionalities?

Basic Image Gallery

This code sample demonstrates how to create a basic image gallery using react-image-gallery. The gallery displays a series of images with corresponding thumbnails.


import React from 'react';
import ImageGallery from 'react-image-gallery';

const images = [
  {
    original: 'https://example.com/image1.jpg',
    thumbnail: 'https://example.com/thumb1.jpg',
  },
  {
    original: 'https://example.com/image2.jpg',
    thumbnail: 'https://example.com/thumb2.jpg',
  },
  {
    original: 'https://example.com/image3.jpg',
    thumbnail: 'https://example.com/thumb3.jpg',
  },
];

const MyGallery = () => (
  <ImageGallery items={images} />
);

export default MyGallery;

Auto Play Slide Show

This code sample shows how to enable the auto-play feature in the image gallery. The gallery will automatically cycle through the images.


import React from 'react';
import ImageGallery from 'react-image-gallery';

const images = [
  {
    original: 'https://example.com/image1.jpg',
    thumbnail: 'https://example.com/thumb1.jpg',
  },
  {
    original: 'https://example.com/image2.jpg',
    thumbnail: 'https://example.com/thumb2.jpg',
  },
  {
    original: 'https://example.com/image3.jpg',
    thumbnail: 'https://example.com/thumb3.jpg',
  },
];

const MyGallery = () => (
  <ImageGallery items={images} autoPlay={true} />
);

export default MyGallery;

Full-Screen Mode

This code sample demonstrates how to enable the full-screen mode in the image gallery. Users can view images in full-screen by clicking the full-screen button.


import React from 'react';
import ImageGallery from 'react-image-gallery';

const images = [
  {
    original: 'https://example.com/image1.jpg',
    thumbnail: 'https://example.com/thumb1.jpg',
  },
  {
    original: 'https://example.com/image2.jpg',
    thumbnail: 'https://example.com/thumb2.jpg',
  },
  {
    original: 'https://example.com/image3.jpg',
    thumbnail: 'https://example.com/thumb3.jpg',
  },
];

const MyGallery = () => (
  <ImageGallery items={images} showFullscreenButton={true} />
);

export default MyGallery;

Other packages similar to react-image-gallery

Keywords

FAQs

Package last updated on 30 Jul 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc