0.0.2 • Published 2 years ago

@hotelkilow/another-react-carousel v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Just Another React Carousel Package

Just another basic barebones React Carousel package

Installing as a package

yarn add @hotelkilow/another-react-carousel

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import Carousel from '@hotelkilow/another-react-carousel';

const images = ['/images/1.jpeg', '/images/2.jpeg', '/images/3.jpeg']

const App = () => <div>
    <Carousel images={images}>
        <div>
            <p>hello</p>
        </div>
    </Carousel>
</div>

ReactDOM.render(<App />, document.querySelector('#root'));

Props

NameValueDescription
imagesstring[]An array of strings for each of the images path
durationnumberInterval in milliseconds on how long until next image appears. Optional. Defaults to 4000.
overlaybooleanAdds overlay on the Carousel Wrapper. Optional. Defaults to true
pauseOnHoverbooleanWether to pause Carousel on mouse hover. Optional.
wrapperPropsReact.HTMLAttributes<HTMLDivElement>Props to attach to the Wrapper. Optional.
imagePropsReact.ImgHTMLAttributes<HTMLImageElement>Props to attach to the img Component. Optional.