angularionic-frameworksliderion-slides

ion-slides with smooth scrolling and no snapping


I'd like to use the <ion-slides> component to create a album thumbnail scroller like on the Spotify mobile app. I have mostly got it working but I want to be able to disable the snapping. Is this possible?

<ion-slides centeredSlides="false" slidesPerView="2.5" spaceBetween="-16">
  <ion-slide padding *ngFor="let album of albums">
    <ion-card>
      <img [src]="album.image">
      <ion-item>
        <h3 ion-text text-center>{{ album.title }}</h3>
        <p ion-text text-center>{{ album.artist }}</p>
      </ion-item>
    </ion-card>
  </ion-slide>
</ion-slides>

I thought there might just be an input setting for the component that disables the snapping but I cannot find anything like this in the docs.


Solution

  • As detailed by Swiper.js in your slider options add the following. See example here https://swiperjs.com/demos/150-freemode.html

    freeMode: true,