angular has dropped swiper. swiper v8 is available directly from swiper but the API has changed and I can not seem to get it to work in ionic 6 . Does anyone have an example of how to use swiper in an ionic angular project.
Hi, you can check out this part from the Ionic documentation:
One thing to notice is that this example is for @ionic/angular
v6 + Swiper v8, so the installation command should be npm install swiper@^8
instead of npm install swiper
:
1 Like
Cross checked with Ionic 6 and its working.
npm install swiper
You can watch complete demo at
//Ionic 6 Angular Swiper JS with Autoplay, Effects, Scrolls, Navigation and more - YouTube
Packages
"dependencies": {
"@angular/common": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/forms": "^15.0.0",
"@angular/platform-browser": "^15.0.0",
"@angular/platform-browser-dynamic": "^15.0.0",
"@angular/router": "^15.0.0",
"@capacitor/android": "4.6.1",
"@capacitor/app": "4.1.1",
"@capacitor/core": "4.6.1",
"@capacitor/haptics": "4.1.0",
"@capacitor/keyboard": "4.1.0",
"@capacitor/status-bar": "4.1.1",
"@ionic/angular": "^6.1.9",
"ionicons": "^6.0.3",
"rxjs": "~7.5.0",
"swiper": "^8.4.5",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
This worked well for me and solved my swiper slides issue