Skip to content

a react component for swipr the minimal touch swipe carousel

Notifications You must be signed in to change notification settings

alancasagrande/react-swipr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

react-swipr

react-swipr is a react component, which is just a wrapper around swipr the minimal touch swipe carousel

Installation

npm install react-swipr --save

Usage

  • 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

style.css

License

MIT

About

a react component for swipr the minimal touch swipe carousel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Other 0.2%