React Responsive Carousel
npm install react-blake-carousel#### Help wanted - please read: https://github.com/leandrowd/react-responsive-carousel/issues/160



Powerful, lightweight and fully customizable carousel component for React apps.
- Responsive
- Mobile friendly
- Swipe to slide
- Mouse emulating touch
- Server side rendering
- Keyboard navigation
- Custom animation duration
- Auto play
- Custom auto play interval
- Infinite loop
- Horizontal or Vertical directions
- Supports images, videos, text content or anything you want. Each direct child represents one slide!
- Supports any flux library (use selectedItem prop to set from the app state, and onChange callback to get the new position)
- Show/hide anything (thumbs, indicators, arrows, status)
Check it out these cool demos created using storybook. The source code for each example is available here
Customize it yourself:
- Webpackbin:
- ~~Codepen:
npm install react-responsive-carousel --save``javascript
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Carousel } from 'react-responsive-carousel';
class DemoCarousel extends Component { Legend 1 Legend 2 Legend 3
render() {
return (



);
}
});
ReactDOM.render(
// Don't forget to include the css in your page
// Using webpack
// import styles from 'react-responsive-carousel/lib/styles/carousel.min.css';
// Using html tag:
//
`
| Attributes | Type | Default | Description |
| :--------- | :--: | :-----: | :----------- |
| showArrows | boolean | true | show prev and next arrows |boolean
| showStatus | | true | show index of the current item. i.e: (1/8) |boolean
| showIndicators | | true | show little dots at the bottom with links for changing the item |boolean
| showThumbs | | true | show thumbnails of the images |number
| thumbWidth | | undefined | optionally specify pixel width (as an integer) of a thumbnail (including any padding) to avoid calculating values (helps with server-side renders or page cache issues) |boolean
| infiniteLoop | | false | infinite loop sliding |number
| selectedItem | | 0 | selects an item though props / defines the initial selected item |string
| axis | | horizontal | changes orientation - accepts horizontal and vertical |string
| verticalSwipe | | standard | changes vertical swipe scroll direction - accepts standard and natural |function
| onChange | | - | Fired when changing positions |function
| onClickItem | | - | Fired when an item is clicked |function
| onClickThumb | | - | Fired when a thumb it clicked |string
| width | | - | Allows to set a fixed width |boolean
| useKeyboardArrows | | false | Adds support to next and prev through keyboard arrows |boolean
| autoPlay | | false | Auto play |boolean
| stopOnHover | | true | Stop auto play while mouse is over the carousel |number
| interval | | 5000 | Interval of auto play |number
| transitionTime | | 350 | Duration of slide transitions (in miliseconds) |number
| swipeScrollTolerance | | 5 | Allows scroll when the swipe movement occurs in a different direction than the carousel axis and within the tolerance - Increase for loose - Decrease for strict |boolean
| dynamicHeight | | false | Adjusts the carousel height if required. -- Do not work with vertical axis -- |boolean
| emulateTouch | | false | Allows mouse to simulate swipe |func
| statusFormatter | | (current, total) => ${current} of ${total} | Allows custom formatting of the status indicator | boolean
| centerMode | | false | Enables centered view with partial prev/next slides. Only works with horizontal axis. |number
| centerSlidePercentage | | 80 | optionally specify percentage width (as an integer) of the slides in centerMode |
=======================
=======================
* A new option is to create a code pen with the code that causes the bug. Fork this base pen and add your code there. Don't forget to save and add the link for the pen to the issue.
=======================
- npm install
- npm start
- Open your favourite browser on localhost:8000 - livereload will be enabled and tests will run on each change> The fastest dev environment is on node 6. If you have
nvm installed, just run nvm use 6. Tests in travis will run on node 4 and 6#### Running only tests
-
npm test#### Running storybook
-
npm run storybook=======================
$3
#### Publish to npm
-
npm run publish-to-npm#### Pubish to gh-pages
-
npm run publish-to-gh-pages`=======================
#### Storybook
#### Codepen
=======================
Quick reads:
- CHANGELOG
- TROUBLESHOOTING
- CONTRIBUTING