1.0.5 • Published 4 years ago

reactjs-carousel-slider v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

ReactJS Carousel Slider

The simplest React slider builder.

This is the simplest library you will find on the web to implement a slider with just a single line

Usage

Install
npm i reactjs-carousel-slider
or yarn add reactjs-carousel-slider
Importing
import ReactJsCarouselSlider from 'reactjs-carousel-slider'
Using
function App() {
    return (
        <div className="App">

            <ReactJsCarouselSlider timer={5000}
                                   pics={[require('./assets/pic1.jpg'), require('./assets/pic2.jpg'), require('./assets/pic3.jpg')]}/>

        </div>
    );
}

Props to pass:

  1. timer - integer, required this is the amount of time you want one picture to last before the second one comes on screen.
  2. borderRadius - string, not required this requirement is not required, but you can pass it to specify the border radius of the pics
  3. pics - array, required this is an array of pics that will be shown on the slide show There are a number of ways to pass this prop as follows:
      a. pics = {arrayOfPics}
      b. pics = {['urlForPic1', 'urlForPic2', '...']}
      if your pics are locally stored then you will probably have to do it like in the example above
      pics={[require('./assets/pic1.jpg'), require('./assets/pic2.jpg'), require('./assets/pic3.jpg')]

visit my personal portfolio to contact me in case of any questions me in case of any questions