React-Slideshow
A simple slideshow component built with react that supports slide, fade and zoom effects. For full documentation click here
Installation
npm install react-slideshow-image -S
yarn add react-slideshow-image
You need to import the css style, you can do that by adding to the js file
or to your css file
;
You can use three different effects of the slideshow. Check examples
Slide Effect
You can use this playground to tweak some values
;; const slideImages = 'images/slide_2.jpg' 'images/slide_3.jpg' 'images/slide_4.jpg'; const Slideshow = { return <div className="slide-container"> <Slide> <div className="each-slide"> <div style='backgroundImage': `url()`> <span>Slide 1</span> </div> </div> <div className="each-slide"> <div style='backgroundImage': `url()`> <span>Slide 2</span> </div> </div> <div className="each-slide"> <div style='backgroundImage': `url()`> <span>Slide 3</span> </div> </div> </Slide> </div> }
Fade Effect
You can use this playground to tweak some values
;; const fadeImages = 'images/slide_5.jpg' 'images/slide_6.jpg' 'images/slide_7.jpg'; const Slideshow = { return <div className="slide-container"> <Fade> <div className="each-fade"> <div className="image-container"> <img src=fadeImages0 /> </div> <h2>First Slide</h2> </div> <div className="each-fade"> <div className="image-container"> <img src=fadeImages1 /> </div> <h2>Second Slide</h2> </div> <div className="each-fade"> <div className="image-container"> <img src=fadeImages2 /> </div> <h2>Third Slide</h2> </div> </Fade> </div> }
Zoom Effect
You can use this playground to tweak some values
;; const images = 'images/slide_2.jpg' 'images/slide_3.jpg' 'images/slide_4.jpg' 'images/slide_5.jpg' 'images/slide_6.jpg' 'images/slide_7.jpg'; const Slideshow = { return <div className="slide-container"> <Zoom scale=04> images </Zoom> </div> }
Properties
Click here for all the properties you can use to customize the behavior of the slideshow.
methods
Click here for all the methods you can call on the slideshow
Typescript
The type bindings have not been added yet to the types registry yet. It's a WIP. You can follow this instruction