When it comes to options, the choices may be limited.
The current swiper
library has native support for Vue3, although it lacks type definitions at the moment. It is anticipated that they will be added soon.
If you want to see a demonstration of swiper + vue3 + typescript in action, check out this codesandbox:
https://codesandbox.io/s/vue-swiper-l3n0h?file=/src/components/HelloWorld.vue
Installing swiper:
npm install swiper
// or
yarn add swiper
To resolve the type declaration error, you will need to create a .d.ts
file to declare the swiper module as suggested by a GitHub user here.
declare module "swiper/vue" {
import { DefineComponent } from "vue";
export const Swiper: DefineComponent<any, any, any>;
export const SwiperSlide: DefineComponent<any, any, any>;
}
For more examples, check out the swiper documentation and experiment with different features: