All Projects → potato4d → Vue Fixed Header

potato4d / Vue Fixed Header

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Fixed Header

Vue Generator
A CLI generator for Vue components, views and store modules
Stars: ✭ 111 (-22.92%)
Mutual labels:  vue-components
V Dialogs
A simple and clean instructional dialog plugin for Vue2, dialog type including Modal, Alert, Mask and Toast
Stars: ✭ 121 (-15.97%)
Mutual labels:  vue-components
Balm Ui
♦️ A modular and customizable UI library based on Material Design and Vue
Stars: ✭ 133 (-7.64%)
Mutual labels:  vue-components
Vue Tables 2
Vue.js 2 grid components
Stars: ✭ 1,518 (+954.17%)
Mutual labels:  vue-components
Vue Fullpage.js
Official Vue.js wrapper for fullPage.js http://alvarotrigo.com/vue-fullpage/
Stars: ✭ 1,626 (+1029.17%)
Mutual labels:  vue-components
Vue Loaders
Vue + loaders.css
Stars: ✭ 127 (-11.81%)
Mutual labels:  vue-components
Vue Parallax Js
Tiny vue component that adds a directive for parallax effect on elements.
Stars: ✭ 107 (-25.69%)
Mutual labels:  vue-components
Vue Shoppingcart
ShoppingCart (Ecommerce) 🛒 Application using Vuejs, + Node.js + Express + MongoDB 🚀🤘
Stars: ✭ 141 (-2.08%)
Mutual labels:  vue-components
Vue Form Components
Clean & minimal vue form elements and form builder with validation
Stars: ✭ 120 (-16.67%)
Mutual labels:  vue-components
Laravel cities
Find any country/city in the world. Get Long/Lat etc. Deploy geonames.org database localy. Optimized DB tree
Stars: ✭ 133 (-7.64%)
Mutual labels:  vue-components
Vue Graph
⚡️ Vue components based on the JUI chart available in Vue.js
Stars: ✭ 114 (-20.83%)
Mutual labels:  vue-components
Vuex Shopping Cart
🛒 Shopping cart built with Vue and Vuex
Stars: ✭ 118 (-18.06%)
Mutual labels:  vue-components
Vue Markdown
A Powerful and Highspeed Markdown Parser for Vue
Stars: ✭ 1,696 (+1077.78%)
Mutual labels:  vue-components
Vue Content Placeholders
Composable components for rendering fake (progressive) content like facebook in vue
Stars: ✭ 1,547 (+974.31%)
Mutual labels:  vue-components
Vue Canvas Nest
💫 A Vue.js background component for canvas-nest.
Stars: ✭ 136 (-5.56%)
Mutual labels:  vue-components
Maz Ui
Stand-alone components library to build your interfaces with Vue.JS & Nuxt.JS
Stars: ✭ 109 (-24.31%)
Mutual labels:  vue-components
Storefront Ui
Customization-first, performance-oriented and elegant UI framework for eCommerce (and not only) based on Vue.js and Google Retail UX Playbook. Made with 💚 by Vue Storefront team and contributors.
Stars: ✭ 1,827 (+1168.75%)
Mutual labels:  vue-components
Require Vuejs
RequireJS plugin to async and dynamic load and parse .vue components
Stars: ✭ 143 (-0.69%)
Mutual labels:  vue-components
Vux Uploader
Stars: ✭ 137 (-4.86%)
Mutual labels:  vue-components
Vue3 News
🔥 Find the latest breaking Vue3、Vue CLI 3+ & Vite News. (2021)
Stars: ✭ 2,416 (+1577.78%)
Mutual labels:  vue-components

Vue Fixed Header

code style: prettier donate: Patreon License: MIT NPM version All Contributors NPM downloads codecov

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

Image from Gyazo

Edit vue-fixed-header demo

Install

yarn add vue-fixed-header

Usage

Use in Single File Component

<template>
  <fixed-header>
    <div class="navbar">
      Your Content
    </div>
  </fixed-header>
</template>

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

export default {
  components: {
    FixedHeader
  }
}
</script>

<style>
.navbar.vue-fixed-header--isFixed {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
}
</style>

Attach classes

The Vue Fixed Header always assigns the vue-fixed-header CSS class to the slot's root element. Also, when matching the fixed condition, we give the vue-fixed-header--isFixed CSS class. These can also be changed with headerClass prop and fixedClass prop.

Props

threshold: number

The threshold value for determining the scroll state.

<template>
  <fixed-header :threshold="100">
    <div class="navbar">
      Your Content
    </div>
  </fixed-header>
</template>

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

export default {
  components: {
    FixedHeader
  }
}
</script>

<style>
.navbar.vue-fixed-header--isFixed {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
}
</style>

headerClass

CSS class for fixed-header root Element. It is always attached to fixed header root Element.

  • type: String,
  • required: false
  • default: 'vue-fixed-header'

fixedClass

CSS class for fixed header. When fixed-header position is relative, it removed to DOM Element. When fixed-header position is fixed, it added to DOM Element.

  • type: String
  • required: false
  • default: 'vue-fixed-header--isFixed'

License

MIT © potato4d

Contributors

Thanks goes to these wonderful people (emoji key):


HANATANI Takuma

💻 🐛 📖 💡 💬 👀

EGOIST

🔧

Johnny Cavalcante

🐛

James Wright

🐛

Sid

⚠️

André Van Dal

💻

Patrik

🐛

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].