react-infinite-image-link-carousel
v0.8.43
Published
Its an infinite image slider with 3 images showing at a time for wonderful UI experience. Middle image is linked with href to go anywhere you wish for
Downloads
38
Maintainers
Readme
react-infinite-image-link-carousel
Install
npm install react-infinite-image-link-carousel --save
Demo
Props
I have kept minimal configurations. Less configurations Less confusions.
Minimum 5 images are required. From which a combination of 3 will be shown at a time. If image list is less than 5, than this package will not work the way it is designed for.
Example
import React from 'react';
import ReactDOM from 'react-dom';
import ReactInfiniteImageLinkCorousal from 'react-infinite-image-link-carousel'
class App extends React.Component {
constructor(props) {
super(props)
// this is the format of imagelist required for this package
// You need to provide image location, along with
// the link you want to go to, else you can keep '#'
this.state = {
imgList: [
{ image: 'imgs/2.jpg', href: '#' },
{ image: 'imgs/5.jpg', href: '#' },
{ image: 'imgs/6.jpg', href: '#' },
{ image: 'imgs/7.jpg', href: '#' },
{ image: 'imgs/8.jpg', href: '#' },
{ image: 'imgs/9.jpg', href: '#' },
{ image: 'imgs/10.jpg', href: '#' }
]
}
}
render() {
return (
<div>
<ReactInfiniteImageLinkCorousal
imageList={this.state.imgList} // Imagelist in the above format is required, rest i'll take care
autoInfiniteSlider={false} // True if you want auto-slide function else false
infiniteSlideTimeScaleInMs={5000} // Mention totals seconda after which slide should happen
heightOfImage={'50vh'} /> // Height of images or corousel
</div>
)
}
}
ReactDOM.render(
<App />,
document.getElementById('app')
);
MIT Licensed
:smiley: