bagpallab7_react_image_carousel
v1.0.0
Published
This is a advance react custom hook that simplify image carousel advance functionality.
Downloads
4
Maintainers
Readme
Copy to install
npm install bagpallab7_react_image_carousel
import to use the package
import useCarousel from "bagpallab7_react_image_carousel";
Extract the functionality
const [imageIndex,handleLeftClick,handleRightClick,handlePositionClick ] = useCarousel("length of image array", "duration of image change");
While using the image url use this
<img src={image-array-name[
imageIndex
]} />here imageIndex that you extracted from useCarousel.
How to call other functionality
onClick={handleLeftClick}
onClick={handleRightClick}
How to call go to exact index position
onClick={()=> handlePositionClick("pass current index of the button/position element")}