Skip to content

RomiC/react-sldr

Repository files navigation

react-sldr Build Status

A small React component to create a responsive slider in your app. It was created to have minimum calculation in JS. Layout is totally controlled over css.

❗ Pls, be aware it's an early alpha-version. Almost proof-of-concept. I will work further on improovements and stability. But PR's and issues are welcome.

Installation

npm install --save react-sldr

Example

<Slider>
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide1" />
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide2" />
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide3" />
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide4" />
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide5" />
  <img src="http://placehold.it/1000x400/ffffff/c0392b/&text=slide6" />
</Slider>

Options

There are few options available:

Parameter Type Description
className String (not required) Additional classname you can append to the basic root element class slider
controls Boolean (default: true) Show/hide control elements
slidesAtOnce Number (default: 1) Number of slides to scroll at once