Lightweight Carousel based on CSS Scroll Snap.
Idea behind this plugin is that to create fully responsive and well optimised Carousel. We used new CSS properties Scroll Snapping, which allows us to lock the Carousel Wrapper to certain Slides or locations after a user has finished scrolling. This helps us to minimize library size, with only critical part, and avoid any heavy JS calculations or any CSS Hacks inside.
- Lightweight (5-10x times lighter than other libs)
- There is no calculation or heavy logic inside (Performence aspect)
- Fully responsive and mostly all customization via CSS - like how many Slides do you want to display
- ESM Bundle with Dead Code Elimination (Tree Shaking)
- SSR Support like Nuxt.js 🎉 (More here)
Vue@3
andVue@2
Support 🎉 (More here)- Support all modern/common browsers (More here)
yarn add vue-snap@next // or npm install vue-snap@next
import { createApp } from 'vue'
import App from './App.vue'
import VueSnap from 'vue-snap'
import 'vue-snap/dist/vue-snap.css'
const myApp = createApp(App)
myApp.use(VueSnap)
myApp.mount('#app')
import { Carousel, Slide } from 'vue-snap'
import 'vue-snap/dist/vue-snap.css'
export default {
components: {
Carousel,
Slide
}
}
yarn add vue-snap // or npm install vue-snap
import Vue from 'vue'
import VueSnap from 'vue-snap'
import 'vue-snap/dist/vue-snap.css'
Vue.use(VueSnap)
import { Carousel, Slide } from 'vue-snap'
import 'vue-snap/dist/vue-snap.css'
export default {
components: {
Carousel,
Slide
}
}
Check out examples folder for more details.
Install necessary depandancies
yarn // or npm install
Run Storybook for development mode
yarn storybook:dev
Release
yarn release
If you have a feature request then feel free to start a new issue, or just grab existing one.
MIT