- install
npm i -D @ginioo/simple-carousel
- add ImageCarousel to a component
import React, {Component} from 'react';
import {ImageCarousel} from '@ginioo/simple-carousel';
class SampleComponent extends Component {
render() {
return (
<div id="sample">
// default slide to the right
<ImageCarousel src="http://via.placeholder.com/350x150" />
<ImageCarousel slide="left" src={[
"http://via.placeholder.com/350x150",
"http://via.placeholder.com/350x150",
]} />
</div>
);
}
}
export default SampleComponent;
- define
#simple-carousel
height and width
#simple-carousel {
width: 1024px;
height: 440px;
}