title: Swiper - How center slides if the total slides width fit in the container width
body: <pre><code>"swiper": "^4.2.6"
  </code></pre>
  
  <p><a href="http://idangero.us/swiper/demos/" rel="nofollow noreferrer">Swiper demo</a></p>
  
  <p><a href="https://github.com/nolimits4web/swiper/" rel="nofollow noreferrer">Swiper repository</a></p>
  
  <p>Hello,
  I have this slider setup:</p>
  
  
  
  <pre><code>const options = {
        wrapperClass: 'slides-list',
        slideClass: 'slide',
        centeredSlides: true,
        slidesPerView: 'auto',  // Default slides per view
        spaceBetween: 20,
        loop: false,
        navigation: {
          prevEl: '.slider_btn--prev',
          nextEl: '.slider_btn--next'
        },
        pagination: {
          el: '.slider_pagination',
          clickable: true,
        },
        speed: 300,
        on: {
          init: function () {
            console.log('swiper initialized');
          },
        }
      };
  </code></pre>
  
  <p>So i have this setup. <em>Black border for the slider wrapper, red border for the slides list</em>.</p>
  
  <p>Works fine on mobile</p>
  
  <p><a href="https://i.stack.imgur.com/pS7Nl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pS7Nl.png" alt="enter image description here"></a></p>
  
  <p>But lets face the moment when all the slides width can fit into the slider wrapper, how can i centered then and maybe disable the drag option.</p>
  
  <p>I dont know the slides widths, so right now in the example i have just 3 slides and this is the current behavior</p>
  
  <p><a href="https://i.stack.imgur.com/MumVm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MumVm.png" alt="enter image description here"></a></p>
  
  <p>And this one would be the desired one</p>
  
  <p><a href="https://i.stack.imgur.com/ddZ2f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddZ2f.png" alt="enter image description here"></a></p>
  
  <p>I cannot use media queries because i dont know when the slides gonna fit in the container. so, Swiper has someway to achieve this ?
  Thanks in advance.</p>
  
  <blockquote>
    <p>I dont want to use <code>slidesPerView: 3</code>, as i said, the point is to be
    able to check all the slides that we have, then if all of them can fit
    in the container, center them. Not to force X number of slides into
    the view</p>
  </blockquote>