vue-scroll-sync

A Vue.js component that syncronize containers scroll positions
51,615 28
Install
npm install vue-scroll-sync
Latest Version:1.0.5
Vue:2
License:MIT
Last Updated:Sep 24, 2026
Links: GitHub  ·  npm
Maintainer: metawin

vue-scroll-sync

A Vue component that syncronize containers scroll positions

Installation

npm i --save vue-scroll-sync

Browser

Include the script file, then install the component with Vue.use(ScrollSync); e.g.:

<script type="text/javascript" src="node_modules/vue/dist/vue.min.js"></script>
<script type="text/javascript" src="node_modules/vue-scroll-sync/dist/scroll-sync.min.js"></script>
<script type="text/javascript">
  Vue.use(ScrollSync);
</script>

Module

import ScrollSync from 'vue-scroll-sync';

Usage

Once installed, it can be used in a template as simply as:

<scroll-sync>
    Content
</scroll-sync>

Demo and Code Example

SSR

Create the plugins/vue-scroll-sync.js :

import Vue from 'vue'
import ScrollSync from 'vue-scroll-sync'

Vue.component('scroll-sync', ScrollSync)

Include plugin in your nuxt.config.js file:

module.exports = {
  plugins: ['~plugins/vue-scroll-sync']
}

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • react-scroll-sync for the scrolling position calculation and the method to prevent the event echo

Version History

Version Released Vue License
1.0.5 ^2.2.1 MIT
1.0.4 ^2.2.1 MIT
1.0.3 ^2.2.1 MIT
1.0.2 ^2.2.1 MIT
1.0.1 ^2.2.1 MIT