All Projects → scaccogatto → smooth-vuebar

scaccogatto / smooth-vuebar

Licence: MIT license
Vue directive wrapper for smooth-scrollbar

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to smooth-vuebar

Ngx Scrollbar
Custom overlay-scrollbars with native scrolling mechanism
Stars: ✭ 355 (+1124.14%)
Mutual labels:  smooth-scrolling, scrollbar
Smooth Scrolling
smooth scrolling and parallax effects on scroll
Stars: ✭ 514 (+1672.41%)
Mutual labels:  smooth-scrolling, scrollbar
Smooth Scrollbar
Customizable, Pluginable, and High-Performance JavaScript-Based Scrollbar Solution.
Stars: ✭ 2,695 (+9193.1%)
Mutual labels:  smooth-scrolling, scrollbar
Easy Scroll
A lightweight native javascript library to perform smooth scrolling with animation
Stars: ✭ 96 (+231.03%)
Mutual labels:  smooth-scrolling
React Smooth Scroll Hook
A React Hook for using smooth scroll in React Component
Stars: ✭ 114 (+293.1%)
Mutual labels:  smooth-scrolling
smooth-parallax
Smooth Parallax makes it a lot easier to move objects when the page scroll with ease.
Stars: ✭ 66 (+127.59%)
Mutual labels:  smooth-scrolling
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (+3455.17%)
Mutual labels:  smooth-scrolling
Good Scroll.el
Attempt at good pixel-based smooth scrolling in Emacs
Stars: ✭ 52 (+79.31%)
Mutual labels:  smooth-scrolling
ngx-malihu-scrollbar
Angular 2+ scrollbar customization using Malihu jQuery Custom Scrollbar plugin
Stars: ✭ 59 (+103.45%)
Mutual labels:  scrollbar
react-is-scrolling
Simply detect if users are scrolling in your components in a declarative API
Stars: ✭ 17 (-41.38%)
Mutual labels:  scrollbar
Moveto
A lightweight scroll animation javascript library without any dependency
Stars: ✭ 2,746 (+9368.97%)
Mutual labels:  smooth-scrolling
Scrollissimo
Javascript plugin for smooth scroll-controlled animations
Stars: ✭ 160 (+451.72%)
Mutual labels:  smooth-scrolling
react-scroll-locky
📜🔒 – React full-cream "anti-scroll" library, you were looking for
Stars: ✭ 55 (+89.66%)
Mutual labels:  scrollbar
Rolly
Custom scroll with inertia, smooth parallax and scenes manager
Stars: ✭ 109 (+275.86%)
Mutual labels:  smooth-scrolling
scrolly.js
Scrolly: fast vanilla JS scrollbar plugin with React.js Component & jQuery/Zepto/jBone plugin.
Stars: ✭ 18 (-37.93%)
Mutual labels:  scrollbar
Scroll Behavior Polyfill
A polyfill for the 'scroll-behavior' CSS-property
Stars: ✭ 76 (+162.07%)
Mutual labels:  smooth-scrolling
esl
Lightweight and flexible UI component library based on web components technology for creating basic UX modules
Stars: ✭ 53 (+82.76%)
Mutual labels:  scrollbar
Longinus
A pure Swift high-performance asynchronous image loading framework. SwiftUI supported.
Stars: ✭ 250 (+762.07%)
Mutual labels:  smooth-scrolling
Vitrin
A simple app that shows categories, subcategories and items.
Stars: ✭ 70 (+141.38%)
Mutual labels:  smooth-scrolling
scrollpup.js
Minimal beautiful bar to show scroll progress. Pure Javascript Plugin.MIT
Stars: ✭ 83 (+186.21%)
Mutual labels:  scrollbar

smooth-vuebar

Vue directive wrapper for smooth-scrollbar

Demo

You can refer to the wrapped library's demo.

Why

There are many other wrappers for this library but none of them implements the original library as directive.

I think directives are the right way to handle this kind of DOM manipulation, so let it be.

Also, there are so many problems I found while trying SSR that the only available choice for me was doing it by myself.

Install

npm i smooth-vuebar

Vue.use(SmoothVuebar)

SSR (nuxt): install as client plugin

Safari and IE: this library requires a CustomEvent polyfill.

Usage

Usually this plugin is used app-wide.

Vue

<template>
  <div>
    <div v-smoothscrollbar="{ listener, options }">
      <router-view />
    </div>
  </div>
</template>

Nuxt & Gridsome

this is a default.vue layout:

<template>
  <div>
    <div
      v-smoothscrollbar="{ listener, options }"
      @insert=".."
      @unbind="..">
      <nuxt />
    </div>
  </div>
</template>

However, you can use it where you want, just mind the default css:

.smooth-vuebar {
  max-width: 100vw;
  max-height: 100vh;
}

And replace it as you wish.

Options

The directive can be customized passing an object.

<div v-smoothscrollbar="{ listener, options }">
  • listener (default: undefined) => can be a function, it will automatically set as listener.

  • options (default: undefined) => can be an object.

Please refer to the offical API docs.

Events

The directive implements two extra events, useful when you want to retrieve the Scrollbar istance and use it.

  • @insert - fired when the DOM element is inserted and the library is loaded on it. The callback may be a function (e).

  • @unbind - fired when the DOM element is unbound and the library is unloaded. The callback may be a function (e).

Extra

You can define global default options. They are valid only if you don't set any local option.

Try it:

Vue.use(SmoothVuebar, {
  listener: () => {},
  options: {}
})

Play with the core

If you want to use the actual wrapper library, here is an helper, available in every component:

this.$scrollbar

Or project-wide

import Vue from 'vue'

Vue.scrollbar

Refer to offical API docs.

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].