Search code examples
javascriptnpmswiper.jslaravel-9

Install swiper slider on Laravel project


how can I install the swiper slider package on my Laravel 9 project?

Package link : swiperjs.com


Solution

  • Using Laravel 9 with Vite and Tailwind. Follow these steps to use Swiper with all its modules:

    1. Install Swiper

      npm install swiper

    2. Add Swiper styles to your app.css

      @import 'swiper/css/bundle';

      Note: If you are using Tailwind you should import Swiper before the Tailwind assets.

    3. Add Swiper to your app.js

      import Swiper from 'swiper/bundle';