[](https://npmjs.org/package/react-id-swiper)
[](https://codecov.io/gh/kidjp85/react-id-swiper)
[](https://npmjs.org/package/react-id-swiper)
[](https://npmjs.org/package/react-id-swiper)
[](https://travis-ci.org/kidjp85/react-id-swiper)
[](http://packagequality.com/#?package=react-id-swiper)
react-id-swiper ( Newest version 4.0.0 )
========================================
> A library to use [Swiper](http://www.idangero.us/swiper/get-started/) as a ReactJs component

What is Swiper?
===============
Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior.
It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps. Designed mostly for iOS, but also works great on latest Android, Windows Phone 8 and modern Desktop browsers.
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity. Swiper does work well with [Gatsby](https://www.gatsbyjs.org/).
# Props
| Name | Type | Default value | Description |
| ------------------ | -------- | ---------------- | -------------------------------------------------|
| ContainerEl | String | 'div' | Element type for container |
| containerClass | String | swiper-container | Swiper container class name |
| WrapperEl | String | 'div' | Element type for wrapper |
| wrapperClass | String | swiper-wrapper | Swiper wrapper class name |
| slideClass | String | swiper-slide | Swiper slide class name |
| shouldSwiperUpdate | Boolean | false | Update swiper when component is updated |
| rebuildOnUpdate | Boolean | false | Rebuild swiper when component is updated |
| noSwiping | Boolean | false | Disable swiping by condition |
| activeSlideKey | String | null | Initial slide index |
| renderPrevButton | function | | Render props function for prev button |
| renderNextButton | function | | Render props function for next button |
| renderScrollbar | function | | Render props function for scrollbar |
| renderPagination | function | | Render props function for pagination |
| renderParallax | function | | Render props function for parallax |
**If you want to use Swiper custom build to reduce bundle size, you need to use extra props below.**
# Custom build extra props
| Name | Type | Default value | Description |
| ------------------ | -------- | ---------------- | -------------------------------------------------|
| Swiper | Class | | Swiper class |
| modules | array | | Array of Swiper necessary modules |
**NOTE:**
* You can also use Swiper's original params too. Swiper API documentation [HERE](http://idangero.us/swiper/api/)
* Find more info about Swiper custom build [HERE](https://idangero.us/swiper/api/#custom-build)
* [<= 3.x documentation](docs/3.x-document.md)
# Documentation
- [Get Started](https://react-id-swiper.ashernguyen.site/doc/get-started)
- [API](https://react-id-swiper.ashernguyen.site/doc/api)
- [Custom Build](https://react-id-swiper.ashernguyen.site/doc/custom-build)
- [Examples](https://react-id-swiper.ashernguyen.site/example/default)
# Installation and setup
- From version 2.0.0, it requires **React & ReactDOM ver >=16.8.0** to use [Hooks](https://reactjs.org/docs/hooks-intro.html)
- From version 2.4.0, it requires **Swiper ver >= 5.0.0**
## Npm package
> By npm
```bash
npm install --save react-id-swiper@latest swiper@latest
```
> By Yarn
```bash
yarn add react-id-swiper@latest swiper@latest
```
## CDN
```html
```
```html
```
# Styling
**Swiper stylesheet file is required**
Use Swiper stylesheet file from CDN
```html
```
```html
```
**Or from Swiper package**
You should import directly from `Swiper` package which supports css, scss and less
> css
```javascript
import 'swiper/css/swiper.css'
```
> scss
```javascript
import 'swiper/swiper.scss'
```
> less
```javascript
import 'swiper/swiper.less'
```
# Examples
## Live Examples
[Codesandbox Live Examples](docs/live-examples.md)
## Default
```javascript
import React from 'react';
import Swiper from 'react-id-swiper';
import 'swiper/css/swiper.css';
const SimpleSwiper = () => (