vue-stickykit

Sticky-kit plugin for Vue.js
12,558 3
Install
npm install vue-stickykit
Latest Version:1.0.6
License:ISC
Last Updated:Aug 10, 2021
Links: GitHub  ·  npm
Maintainer: imfaber

Sticky-kit plugin for Vue.js

A Vue.js(v2.x+) integration of http://leafo.net/sticky-kit/

See also https://imfaber.me/lab/sticky-kit-plugin-vuejs

Installation

Install the npm package.

$ npm install vue-stickykit --save

Register the component.

  • ES5
var Vue = require('vue')
var VueStickyKit = require('vue-stickykit')
Vue.use(VueStickyKit)
  • ES6
import Vue from 'vue'
import VueStickyKit from 'vue-stickykit'
Vue.use(VueStickyKit)

Usage

Basic Sticking
<template>
    <div v-stick-in-parent>
        My sticky content
    </div>
</template>
Custom Sticking
<template>
    <div v-stick-in-parent="stikyKit">
        My sticky content
    </div>
</template>

<script>
    export default {
        data () {
          return {
            // See http://leafo.net/sticky-kit/#reference
            stikyKit: {
              options: {
                parent: '.my-sticky-class',
                offset_top: 50
              },
              on: {
                'sticky_kit:stick': function(e) {
                  console.log("has stuck!", e.target);
                },
                'sticky_kit:unstick': function(e) {
                  console.log("has unstuck!", e.target);
                },
              }
            }
          }
        },
    }
</script>

License

The code is available under the MIT license.

Related Packages

vue-validator

Validator component for Vue.js

80,472 2,167
vue-grapesjs

GrapesJS plugin for Vue.js

1,703 21
vue-youtube

YouTube IFrame Player API wrapper

629,279 333
@marvr/storyblok-rich-text-vue-renderer

Vue.js plugin for Storyblok's rich-text renderer

81,454
vue-sorted-table

A Vue.js plugin to sort table content.

25,501 33

Version History

Version Released License
1.0.6 ISC
1.0.5 ISC
1.0.4 ISC
1.0.3 ISC
1.0.2 ISC