/vue-fixed-header

Simple and cross-browser friendly fixed header component for Vue.js written by TypeScript.

Primary LanguageVueMIT LicenseMIT

Vue Fixed Header

All Contributors

NPM version NPM downloads CircleCI

Simple and cross-browser friendly fixed header component for Vue.js.

8d82f81b0f64d044ada918a7b9f3c574

Install

yarn add vue-fixed-header

Usage

<template>
  <fixed-header :fixed.sync="isFixed">
    <div :class="{ 'is-fixed': isFixed }">
      Your Content
    </div>
  </fixed-header>
</template>

<script>
import FixedHeader from 'vue-fixed-header'

export default {
  components: {
    FixedHeader
  },
  data () {
    return {
      isFixed: false
    }
  }
}
</script>

Props

threshold: number

The threshold value for determining the scroll state.

<template>
  <fixed-header :fixed.sync="isFixed" :threshold="100">
    <div :class="{ 'is-fixed': isFixed }">
      Your Content
    </div>
  </fixed-header>
</template>

<script>
import FixedHeader from 'vue-fixed-header'

export default {
  components: {
    FixedHeader
  },
  data () {
    return {
      isFixed: false
    }
  }
}
</script>

License

MIT © potato4d

Contributors

Thanks goes to these wonderful people (emoji key):


HANATANI Takuma

💻 🐛 📖 💡 💬 👀

EGOIST

🔧

Johnny Cavalcante

🐛

James Wright

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!