react-css-only-carousel
v1.0.3
Published
A beautifully simple CSS-only React component for a responsive image carousel
Downloads
13
Readme
react-css-only-carousel
A beautifully simple CSS-only React component for a responsive image carousel
Install
npm install --save react-css-only-carousel
Usage
import React from "react"
import Carousel from "react-css-only-carousel"
const Example = () => {
return (
<Carousel
images={[
"https://i.picsum.photos/id/308/500/900.jpg",
"https://i.picsum.photos/id/301/900/800.jpg",
"https://i.picsum.photos/id/209/1800/600.jpg",
"https://i.picsum.photos/id/109/1200/600.jpg",
"https://i.picsum.photos/id/409/1400/600.jpg"
]}
slideHeight="500px" // @optional @default = "300px"
gapBetweenSlides="0px" // @optional @default = "50px"
arrowsColor="rgba(0,0,255,0.3)" // @optional @default = "rgba(255,255,255,0.4)"
hideArrows={false} // @optional @default = false
scrollBarHeight="15px" // @optional @default = "10px"
scrollBarTrackColor="rgba(0,0,0,0.1)" // @optional @default = "transparent"
scrollBarThumbColor="orange" // @optional @default = "rgba(0,0,0,0.
scrollBarBorderRadius="10px" // @optional (does not work on Firefox) @default = "10px"
/>
)
}
Demo
License
MIT © brunocrosier