{"id":14384,"date":"2022-03-23T11:44:27","date_gmt":"2022-03-23T10:44:27","guid":{"rendered":"https:\/\/hesmid.nl\/test\/?p=14384"},"modified":"2022-03-23T11:45:30","modified_gmt":"2022-03-23T10:45:30","slug":"swiper-the-most-modern-mobile-touch-slider","status":"publish","type":"post","link":"https:\/\/hesmid.nl\/test\/swiper-the-most-modern-mobile-touch-slider\/","title":{"rendered":"Swiper &#8211; The Most Modern Mobile Touch Slider"},"content":{"rendered":"\n<p><a href=\"https:\/\/swiperjs.com\/\">https:\/\/swiperjs.com\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/swiperjs.com\/demos\">https:\/\/swiperjs.com\/demos<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"973\" height=\"579\" src=\"https:\/\/hesmid.nl\/test\/wp-content\/uploads\/2022\/03\/image-7.png\" alt=\"\" class=\"wp-image-14385\" srcset=\"https:\/\/hesmid.nl\/test\/wp-content\/uploads\/2022\/03\/image-7.png 973w, https:\/\/hesmid.nl\/test\/wp-content\/uploads\/2022\/03\/image-7-300x179.png 300w, https:\/\/hesmid.nl\/test\/wp-content\/uploads\/2022\/03\/image-7-150x89.png 150w, https:\/\/hesmid.nl\/test\/wp-content\/uploads\/2022\/03\/image-7-768x457.png 768w\" sizes=\"(max-width: 973px) 100vw, 973px\" \/><\/figure>\n\n\n\n<p>Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native\/hybrid apps.<\/p>\n\n\n\n<p>Swiper is not compatible with all platforms, <strong>it is a modern touch slider which is focused only on modern apps\/platforms to bring the best experience and simplicity<\/strong>.<\/p>\n\n\n\n<p>Swiper, along with other great components, is a part of <a href=\"https:\/\/framework7.io\">Framework7<\/a> &#8211; a fully-featured framework for building iOS &amp; Android apps. Swiper is also a default slider component in the <a href=\"https:\/\/ionicframework.com\/\">Ionic Framework<\/a>.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Get started<\/h2>\n\n\n\n<p id=\"installation\"><strong>Installation<\/strong><\/p>\n\n\n\n<p>There are few options on how to include\/import Swiper into your project:<\/p>\n\n\n\n<p id=\"install-from-npm\"><a href=\"https:\/\/swiperjs.com\/get-started#install-from-npm\"><\/a><strong>Install from NPM<\/strong><\/p>\n\n\n\n<p>We can install Swiper from NPM<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>  $ npm install swiper\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>  \/\/ import Swiper JS\n  import Swiper from 'swiper';\n  \/\/ import Swiper styles\n  import 'swiper\/css';\n\n  const swiper = new Swiper(...);\n<\/code><\/pre>\n\n\n\n<p>By default Swiper exports only core version without additional modules (like Navigation, Pagination, etc.). So you need to import and configure them too:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>  \/\/ core version + navigation, pagination modules:\n  import Swiper, { Navigation, Pagination } from 'swiper';\n  \/\/ import Swiper and modules styles\n  import 'swiper\/css';\n  import 'swiper\/css\/navigation';\n  import 'swiper\/css\/pagination';\n\n  \/\/ init Swiper:\n  const swiper = new Swiper('.swiper', {\n    \/\/ configure Swiper to use modules\n    modules: &#91;Navigation, Pagination],\n    ...\n  });\n<\/code><\/pre>\n\n\n\n<p>If you want to import Swiper with all modules (bundle) then it should be imported from <code>swiper\/bundle<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>  \/\/ import Swiper bundle with all modules installed\n  import Swiper from 'swiper\/bundle';\n\n  \/\/ import styles bundle\n  import 'swiper\/css\/bundle';\n\n  \/\/ init Swiper:\n  const swiper = new Swiper(...);\n<\/code><\/pre>\n\n\n\n<p>See further on <a href=\"https:\/\/swiperjs.com\/get-started\">https:\/\/swiperjs.com\/get-started<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Swiper for Vue<\/h2>\n\n\n\n<p>Swiper Vue.js plugin is available only via NPM as a part of the main Swiper library:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>  npm i swiper\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"usage\">Usage<\/h3>\n\n\n\n<p><code>swiper\/vue<\/code> exports 2 components: <code>Swiper<\/code> and <code>SwiperSlide<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>&lt;template&gt;\n  &lt;swiper\n    :slides-per-view=\"3\"\n    :space-between=\"50\"\n    @swiper=\"onSwiper\"\n    @slideChange=\"onSlideChange\"\n  &gt;\n    &lt;swiper-slide&gt;Slide 1&lt;\/swiper-slide&gt;\n    &lt;swiper-slide&gt;Slide 2&lt;\/swiper-slide&gt;\n    &lt;swiper-slide&gt;Slide 3&lt;\/swiper-slide&gt;\n    ...\n  &lt;\/swiper&gt;\n&lt;\/template&gt;\n&lt;script&gt;\n  \/\/ Import Swiper Vue.js components\n  import { Swiper, SwiperSlide } from 'swiper\/vue';\n\n  \/\/ Import Swiper styles\n  import 'swiper\/css';\n\n  export default {\n    components: {\n      Swiper,\n      SwiperSlide,\n    },\n    setup() {\n      const onSwiper = (swiper) =&gt; {\n        console.log(swiper);\n      };\n      const onSlideChange = () =&gt; {\n        console.log('slide change');\n      };\n      return {\n        onSwiper,\n        onSlideChange,\n      };\n    },\n  };\n&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<p>By default Swiper Vue.js uses core version of Swiper (without any additional modules). If you want to use Navigation, Pagination and <a href=\"https:\/\/swiperjs.com\/swiper-api\/#custom-build\">other modules<\/a>, you have to install them first.<\/p>\n\n\n\n<p>See further on <a href=\"https:\/\/swiperjs.com\/vue\">https:\/\/swiperjs.com\/vue<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/swiperjs.com\/ https:\/\/swiperjs.com\/demos Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native\/hybrid apps. Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps\/platforms [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[37,101,661,94,748,747,555],"acf":[],"_links":{"self":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/14384"}],"collection":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/comments?post=14384"}],"version-history":[{"count":2,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/14384\/revisions"}],"predecessor-version":[{"id":14387,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/14384\/revisions\/14387"}],"wp:attachment":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/media?parent=14384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/categories?post=14384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/tags?post=14384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}