RomiC / react-sldr

Responsive slider component for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Responsive slider component for React

License:MIT License


Languages

Language:TypeScript 81.5%Language:CSS 12.8%Language:JavaScript 5.7%