|
| 1 | +# React Styled Slider |
| 2 | +**React Styled Slider** is a react and styled component slider. It is fully configurable. |
| 3 | + |
| 4 | +[](https://travis-ci.org/ItsMrAkhil/react-styled-carousel) |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +#### Features |
| 9 | + - Mostly configurable |
| 10 | + - Styled-Components |
| 11 | + - No external CSS required. |
| 12 | + - Server Side Rendering supported |
| 13 | + |
| 14 | +> **Note:** **Server Side Rendering** works well without the styled-components collectStyles function also. But for better user experience please use **collectStyles** function from **styled-components** |
| 15 | +
|
| 16 | +#### Installation |
| 17 | +```sh |
| 18 | +$ npm install --save react-styled-carousel |
| 19 | +``` |
| 20 | + |
| 21 | +#### Running example in local |
| 22 | +```sh |
| 23 | +$ git clone github.com/itsMrAkhil/react-styled-carousel |
| 24 | +$ npm start |
| 25 | +``` |
| 26 | +It'll open localhost:9000 port, where you can see live demo. |
| 27 | + |
| 28 | +#### Example |
| 29 | +```js |
| 30 | +import React from 'react'; |
| 31 | +import ReactDOM from 'react-dom' |
| 32 | +import Slider from 'react-styled-carousel'; |
| 33 | + |
| 34 | +const ExampleSlider = () => ( |
| 35 | + <Slider> |
| 36 | + <h1>1</h1> |
| 37 | + <h1>2</h1> |
| 38 | + <h1>3</h1> |
| 39 | + <h1>4</h1> |
| 40 | + </Slider> |
| 41 | +); |
| 42 | + |
| 43 | +ReactDOM.render(<ExampleSlider />, document.getElementById('root')); |
| 44 | +``` |
| 45 | + |
| 46 | +#### Configurable Props |
| 47 | +Props | Type | Default Value | Description |
| 48 | +----- | ---- | ------------- | ----------- |
| 49 | +`showArrows` | `Boolean` | `true` | If `true` then only Arrows of navigation will be shown |
| 50 | +`LeftArrow` | `React Node` | Default | Customized left arrow button |
| 51 | +`RightArrow` | `React Node` | Default | Customized right arrow button |
| 52 | +`showDots` | `Boolean` | `true` | Show navigation or pagination dots below the slider |
| 53 | +`Dot` | `React Node` | Default | Customized pagination button (`Active slide Dot` will get `active` as `Boolean` prop.) |
| 54 | +`children` | `React Node` | null | Cards are components which you want to show in the carousel |
| 55 | +`cardsToShow` | `Number` | Children length | How many cards to be shown for a single slide. |
| 56 | +`afterSlide` | `Function` | null | This function will be executed after every sliding is completed |
| 57 | +`beforeSlide` | `Function` | null | This function will be executed before starting every sliding |
| 58 | + |
| 59 | +License |
| 60 | +---- |
| 61 | +MIT (**Free Software, Chill Yeah!**) |
0 commit comments