
Astro Swiper is the native Astro component for Swiper, dedicated to slides / carousel / photo swiper.

Get the latest version from NPM:
$ npm install astro-swiper
Here is the astro code of a loop carousel, of 3 pictures, with 1 second interval:
---
import { Swiper, SwiperWrapper, SwiperSlide } from "astro-swiper";
---
<Swiper
options={{ // check options at https://swiperjs.com/swiper-api
autoplay: {
delay: 700,
disableOnInteraction: false,
waitForTransition: false,
},
loop: true,
}}>
<SwiperWrapper>
<!-- Slides -->
<SwiperSlide>
<img src="https://picsum.photos/455/256?nb=1" alt="" />
</SwiperSlide>
<SwiperSlide>
<img src="https://picsum.photos/455/256?nb=2" alt="" />
</SwiperSlide>
<SwiperSlide>
<img src="https://picsum.photos/455/256?nb=3" alt="" />
</SwiperSlide>
</SwiperWrapper>
</Swiper>
<style>
.swiper {
max-width: 455px;
aspect-ratio: 16/9;
}
img {
width: 100%;
}
</style>
Please check the online doc for a fullset of examples, including navigation and thumbnails.
Full code is provided.
Please star the project if you like it!