react-swipr is a react component, which is just a wrapper around swipr the minimal touch swipe carousel
npm install react-swipr --save
- add some html
<div id="container">
</div>
<script type="text/javascript" src="bundle.js"></script>
- now some javascript to render the react-swipr component...
react-swipr initializes the swipr on component mount
var React = require("react");
var Swipr = require('react-swipr');
// if you added multiple to the page you would render each as below but with different ids.
React.render( <Swipr elementId="product-swipr">
<li>1</li>
<li>2</li>
<li>3</li>
</Swipr>
,
document.getElementById("container")
);
-
remember to pass in unique element id's for each swipr, if you want multiple swiprs on one page.
-
you need some minimal css for styling your slides