# react-image-gallery-lightbox

> React lightweight image gallery with lightbox

Latest version **0.0.30** (published 2016-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-image-gallery-lightbox
pnpm add react-image-gallery-lightbox
yarn add react-image-gallery-lightbox
bun add react-image-gallery-lightbox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.30 |
| Published | 2016-10-02 |
| First published | 2016-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oleg Nosov |
| Maintainers | olegnn |
| Keywords | react, image, gallery, lightbox |

## Links

- npm: https://www.npmjs.com/package/react-image-gallery-lightbox
- Repository: https://github.com/olegnn/react-image-gallery-lightbox
- Homepage: https://github.com/olegnn/react-image-gallery-lightbox#readme
- Issues: https://github.com/olegnn/react-image-gallery-lightbox/issues
- npm.io page: https://npm.io/package/react-image-gallery-lightbox

## Dependencies (3)

- [react-portal](https://npm.io/package/react-portal.md) ^2.2.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.11.6
- [react-image-lightbox-universal](https://npm.io/package/react-image-lightbox-universal.md) 0.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.30 (latest) — 2016-10-02
- 0.0.29 — 2016-10-01
- 0.0.27 — 2016-09-27
- 0.0.26 — 2016-09-27
- 0.0.25 — 2016-09-27
- 0.0.24 — 2016-09-26
- 0.0.23 — 2016-09-26
- 0.0.22 — 2016-09-25
- 0.0.21 — 2016-09-24
- 0.0.20 — 2016-09-24
- 0.0.19 — 2016-09-24
- 0.0.18 — 2016-09-24
- 0.0.17 — 2016-09-24
- 0.0.16 — 2016-09-23
- 0.0.15 — 2016-09-23
- … 10 more at https://npm.io/package/react-image-gallery-lightbox/versions

## README

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

# ImageGallery

**Extends React.Component**

React Component that represents an image gallery,
consists of 1-4 images.

You can use count + path + sizes props or
srcList + path props to create gallery

In order to use count + path + sizes template
each image must have name in the format: {path}/{imageNumber}-{size}.jpeg.

Else you can hardcode each path using srcList prop.

**Meta**

-   **author**: Oleg Nosov &lt;olegnosov1@gmail.com>
-   **license**: MIT

## propTypes

**Properties**

-   `srcList` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>>** All gallery image paths.
    If you use this prop, don't specify count and sizes - they will
    be ignored.
    That array may contain 0-4 arrays of 3 strings.
    Each array of 3 strings - is an array of 3 image sizes paths,
    ['pathToSmallCat.jpeg', 'pathToMediumCat.jpeg', 'pathToBigCat.jpeg'] for example.
    Default is an empty array
-   `count` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Image count.
    Max value is 4, min is 0.
    Default is 0
-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path to images. Default is an empty string
-   `sizes` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** Array of image sizes.
    Must contain 3 elements:
    1st - small image (thumbnail),
    2nd - medium image (main in gallery),
    3rd - big image (lightbox preview).
    Default is ['102x68', '483x321', '800x533']


##Demo

Live demo: [`https://www.solarleague.org/shop/macbook-case/`](https://www.solarleague.org/shop/macbook-case/)

**Usage**
```shell
npm install --save react-image-gallery-lightbox
```

**Example**
```javascript
import React from 'react';
import ImageGallery from 'react-image-gallery-lightbox';

import 'bootstrap/dist/css/bootstrap.css';
import 'react-image-gallery-lightbox/dist/image-gallery.css';
// If you have 3 instances(small, medium, big) of two images
// in folder /images/ like
//
// /images/1-85x50.jpeg,
// /images/1-680x400.jpeg,
// /images/1-1920x1080.jpeg
//
// /images/2-85x50.jpeg,
// /images/2-680x400.jpeg,
// /images/2-1920x1080.jpeg
<ImageGallery count={2} path="/images/" sizes={['85x50', '680x400', '1920x1080']}>
  <h3> Text content </h3>
</ImageGallery>
  // to show all of them
<ImageGallery count={1} path="/images/" sizes={['85x50', '680x400', '1920x1080']}>
  <h3> Text content </h3>
</ImageGallery>
  // to show only one image from list
// Of course you can specify each path as you wish
<ImageGallery
  srcList={[
    [
      '/images/1-85x50.jpeg',
      '/images/1-680x400.jpeg',
      '/images/1-1920x1080.jpeg'
    ],
    [
      '/images/2-85x50.jpeg',
      '/images/2-680x400.jpeg',
      '/images/2-1920x1080.jpeg'
    ]
  ]}
>
  <h3> Text content </h3>
</ImageGallery>
```

##Development

**Build**

```shell
npm run build
```
And then check dist folder


**Testing**

[Jest](https://github.com/facebook/jest) is used for tests
```shell
npm run test
```

**Linter**

[ESLint](https://github.com/eslint/eslint) is used as linter
```shell
npm run lint
```

**Flow Type**

Check types in project using [Flow](https://github.com/facebook/flow)
```shell
npm run flow
```

**Autodoc**

Generate doc using [documentation js](https://github.com/documentationjs/documentation)
```shell
npm run doc
```
And then look at README.md

---
_Source: https://npm.io/package/react-image-gallery-lightbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
