# react-swipe-gallery

> React Swipe Gallery Component

Latest version **0.6.3** (published 2019-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-swipe-gallery
pnpm add react-swipe-gallery
yarn add react-swipe-gallery
bun add react-swipe-gallery
```

## 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.6.3 |
| Published | 2019-04-30 |
| First published | 2016-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | amadormateof |

## Links

- npm: https://www.npmjs.com/package/react-swipe-gallery
- Repository: https://github.com/amadormf/react-swipe-gallery
- npm.io page: https://npm.io/package/react-swipe-gallery

## Dependencies (4)

- [classnames](https://npm.io/package/classnames.md) ^2.2.4
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.5.0
- [react-swipeable](https://npm.io/package/react-swipeable.md) ^4.2.0

## Recent versions

- 0.6.3 (latest) — 2019-04-30
- 0.6.2 — 2019-04-30
- 0.6.1 — 2019-04-30
- 0.5.8 — 2017-05-24
- 0.5.7 — 2017-04-10
- 0.5.6 — 2016-05-11
- 0.5.5 — 2016-05-11
- 0.5.4 — 2016-05-10
- 0.5.3 — 2016-05-09
- 0.5.2 — 2016-05-09
- 0.5.1 — 2016-05-09
- 0.4.0 — 2016-05-09
- 0.3.1 — 2016-05-09
- 0.3.0 — 2016-04-28
- 0.2.0 — 2016-04-28
- … 1 more at https://npm.io/package/react-swipe-gallery/versions

## README

# React Swipe Gallery Component

Swipe gallery over React

You can view an online example in [http://amadormf.github.io/react-swipe-gallery/](http://amadormf.github.io/react-swipe-gallery/)

##Install

`npm install --save react-swipe-gallery`

##Example

```javascript
import SwipeGallery from 'react-swipe-gallery'

//elements only for example
function getElements(numElements) {
  const elements = [];
  for (let i = 0; i < numElements; ++i) {
    elements.push(
      <div className="subelement" key={i}>
        { i }
      </div>
    );
  }
  return elements;
}

//swipe gallery example
const gallery = (
  <SwipeGallery
    elements={getElements(5)}
    maxElement={3}
  />  
);
```

##Props

|Props Name | Type         | Default  | Description              |
|-----------|--------------|:--------:|----------------|
|elements   |Array         |          |Element of gallery        |
|maxElements|Number        |    1     |Max number of elements    |   
|onChangePosition|Function |          |Call when change the elements visibles|
|orientation|String        |HORIZONTAL|SwipeGallery.VERTICAL or SwipeGallery.HORIZONTAL|
|className  |String        |          |Custom name class         |
|buffer     |Bool          |  true    |if is true add a buffer for quickly transition|
|hideArrow  |Bool          |  false   |If is true don't show the arrows|
|hideArrowWithNoElements|Bool       |true   |If is true and maxElements > elements.length don't show the arrows|
|customStyles|String       |          |Add inline styles to component|
|disableSwipe|Bool         |  false   |Disable swipe event | 
|stopPropagation| Bool     |  false   |If is true, call a stopPropagation on touch events'| 
|infinityGallery |Bool         |  true   |If is true the gallery is infinity|
|arrow |Object |{ prev: '❮', next: '❯',} | Change the arrow, you can send a string or a element|
|initialPosition|Number | 0 | Initial position of gallery |
|position| Number | | Change position of gallery |

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