-
-
Save Daltonic/48467114b5ca759bb0d52e8c4b79d7ed to your computer and use it in GitHub Desktop.
DappBnb Project ImageSlider Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Swiper, SwiperSlide } from "swiper/react"; | |
import { Autoplay, Pagination, Navigation } from "swiper"; | |
const ImageSlider = ({ images }) => { | |
return ( | |
<Swiper | |
spaceBetween={30} | |
centeredSlides={true} | |
autoplay={{ | |
delay: 2500, | |
disableOnInteraction: false, | |
}} | |
pagination={{ | |
clickable: true, | |
}} | |
navigation={false} | |
modules={[Autoplay, Pagination, Navigation]} | |
className="w-96 h-52 rounded-t-2xl overflow-hidden" | |
> | |
{images.map((url, i) => ( | |
<SwiperSlide key={i}> | |
<img | |
className="w-full" | |
src={url} | |
alt="image slide 1" | |
/> | |
</SwiperSlide> | |
))} | |
</Swiper> | |
); | |
}; | |
export default ImageSlider; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment