# react-images-maintained

> A mobile-friendly, highly customizable, carousel component for displaying media in ReactJS

Latest version **2.0.4** (published 2019-11-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-images-maintained
pnpm add react-images-maintained
yarn add react-images-maintained
bun add react-images-maintained
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2019-11-20 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 230.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | David Wheatley |
| Maintainers | davwheat |
| Keywords | react, images, carousel, lightbox, gallery, modal |

## Links

- npm: https://www.npmjs.com/package/react-images-maintained
- Repository: https://github.com/davwheat/react-images
- Homepage: https://davwheat.github.io/react-images/
- Issues: https://github.com/davwheat/react-images/issues
- npm.io page: https://npm.io/package/react-images-maintained

## Dependencies (8)

- [glam](https://npm.io/package/glam.md) ^5.0.1
- [raf-schd](https://npm.io/package/raf-schd.md) ^2.1.2
- [cross-env](https://npm.io/package/cross-env.md) ^6.0.3
- [a11y-focus-store](https://npm.io/package/a11y-focus-store.md) ^1.0.0
- [react-scrolllock](https://npm.io/package/react-scrolllock.md) ^4.0.1
- [react-view-pager](https://npm.io/package/react-view-pager.md) ^0.6.0
- [react-full-screen](https://npm.io/package/react-full-screen.md) ^0.2.4
- [react-transition-group](https://npm.io/package/react-transition-group.md) ^2.9.0

## 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

- 2.0.4 (latest) — 2019-11-20
- 2.0.3 — 2019-11-20
- 2.0.2 — 2019-11-20
- 2.0.1 — 2019-11-20
- 2.0.0 — 2019-11-20

## README

# React Images

A mobile-friendly, highly customizable, carousel component for displaying media in ReactJS.

Maintained fork of [jossmac/react-images](https://github.com/jossmac/react-images).

### Getting Started

Start by installing `react-images-maintained`

```bash
npm install react-images-maintained
```

or

```bash
yarn add react-images-maintained
```

**If you were using `0.x` versions:** library was significantly rewritten for `1.x` version and contains several breaking changes.
The best way to upgrade is to read the docs and follow the examples.

### Using the Carousel

Import the carousel from `react-images-maintained` at the top of a
component and then use it in the render function.

```jsx
import React from 'react';
import Carousel from 'react-images-maintained';

const images = [{ src: 'path/to/image-1.jpg' }, { src: 'path/to/image-2.jpg' }];

class Component extends React.Component {
  render() {
    return <Carousel views={images} />;
  }
}
```

### Using the Modal

Import the modal and optionally the modal gateway from
`react-images-maintained` at the top of a component and then use it in
the render function.

The `ModalGateway` will insert the modal just before the
end of your `<body />` tag.

```jsx
import React from 'react';
import Carousel, { Modal, ModalGateway } from 'react-images-maintained';

const images = [{ src: 'path/to/image-1.jpg' }, { src: 'path/to/image-2.jpg' }];

class Component extends React.Component {
  state = { modalIsOpen: false };
  toggleModal = () => {
    this.setState(state => ({ modalIsOpen: !state.modalIsOpen }));
  };
  render() {
    const { modalIsOpen } = this.state;

    return (
      <ModalGateway>
        {modalIsOpen ? (
          <Modal onClose={this.toggleModal}>
            <Carousel views={images} />
          </Modal>
        ) : null}
      </ModalGateway>
    );
  }
}
```

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