How to use the smooth-scrollbar.ScrollbarPlugin function in smooth-scrollbar

To help you get started, we’ve selected a few smooth-scrollbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Aqro / gooey-hover-codrops / src / js / utils / HorizontalScrollPlugin.js View on Github external
import Scrollbar from 'smooth-scrollbar'

export default class HorizontalScrollPlugin extends Scrollbar.ScrollbarPlugin {

    transformDelta(delta, fromEvent) {
        if (this.shouldInvertDelta(fromEvent)) {
            return {
                x: delta.y,
                y: delta.y,

        return delta

    shouldInvertDelta(fromEvent) {
        return => fromEvent.type.match(rule))


Customize scrollbar in modern browsers with smooth scrolling experience.

Latest version published 9 months ago

Package Health Score

72 / 100
Full package analysis