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.3
Source
npmnpm
Version published
Weekly downloads
270
-7.85%
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

NPM:

npm install react-image-grid-gallery

Yarn:

yarn add react-image-grid-gallery

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 Home() {
  return <ImageGallery imgArray={imagesArray} columnWidth={230} gapSize={24} />;
}

Required Props

PropsTypeDefaultDescription
imgArrayarrayundefined

Required. An array of objects containing the following properties:

  • alt: The image's alternative text. Required.
  • caption: The image's description. Optional.
  • src: The image's URL. Required.
columnWidthnumber230

Optional. The minimum width of the gallery's columns.

gapSizenumber24

Optional. The gallery's gap size.

Keywords

react

FAQs

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