You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-image-grid-gallery

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-grid-gallery

A simple image gallery component for displaying a grid of images in React apps

0.9.0
Source
npmnpm
Version published
Weekly downloads
267
9.88%
Maintainers
1
Weekly downloads
 
Created
Source

A simple, easy-to-use, and responsive image gallery component for displaying a grid of images in React apps.

npm NPM

Installation

Using npm:

npm install react-image-grid-gallery

Using yarn:

yarn add react-image-grid-gallery

Using pnpm:

pnpm add react-image-grid-gallery

Usage

import ImageGallery from "react-image-grid-gallery";

const imagesArray = [
  {
    alt: "Image1's alt text",
    caption: "Image1's description",
    src: "http://example.com/image1.jpg",
  },
  {
    alt: "Image2's alt text",
    caption: "Image2's description",
    src: "http://example.com/image2.png",
  },
  {
    alt: "Image3's alt text",
    caption: "Image3's description",
    src: "http://example.com/image3.webp",
  },
];

function App() {
  return <ImageGallery imgArray={imagesArray} columnWidth={300} gapSize={7} />;
}

Required Props

PropsDescription
imgArray

Required. The imgArray prop is an array of objects containing the following properties:

  • alt: Required. The image's alternative text.
  • caption: Optional. A description of the image.
  • src: Required. The URL of the image.
columnWidth

Optional. The columnWidth prop is a number specifying the minimum width of the gallery's columns.

230 is the default value.

gapSize

Optional. The gapSize prop is a number specifying the gallery gap's size.

24 is the default value.

Keywords

react

FAQs

Package last updated on 30 May 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