
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
smooth-scrollbar
Advanced tools
Customize scrollbar in modern browsers with smooth scrolling experience.
| Browser | Version |
|---|---|
| IE | 10+ |
| Chrome | 22+ |
| Firefox | 16+ |
| Safari | 8+ |
| Android Browser | 4+ |
| Chrome for Android | 32+ |
| iOS Safari | 7+ |
Via npm:
npm install smooth-scrollbar --save
Via bower:
bower install smooth-scrollbar --save
http://idiotwu.github.io/smooth-scrollbar/
As is explained in this article, browser repaint every frame in scrolling. Less painting is better.
To avoid repainting, I use translate3d in scroll content to create composite layers and force hardware accelerating.
Smooth scrollbar is defined as an UMD module which named Scrollbar, you can use any loader to load it:
import Scrollbar from 'smooth-scrollbar';
Or get it from window object:
const { Scrollbar } = window;
Don't forget to include the stylesheet in your page:
<link rel="stylesheet" href="dist/smooth-scrollbar.css">
Here're three ways to tell the plugin which element should be a smooth scrollbar:
As an element:
<scrollbar>
...
</scrollbar>
As an attribute:
<section scrollbar>
...
</section>
As a data attribute
<section data-scrollbar>
...
</section>
Then init all scrollbars:
Scrollbar.initAll(options);
Or you can call Scrollbar.init(elem, options) to manually init the scrollbar.
| parameter | type | default | description |
|---|---|---|---|
| speed | Number | 1 | Scrolling speed scale. |
| fricton | Number | 10 | Scrolling fricton, a percentage value within (1, 100) |
| ignoreEvents | Array | [ RegExp ] | A list of events names that are ignored, all handled events are: ["blur", "click", "dragend", "dragover", "dragstart", "focus", "keydown", "mousedown", "mousemove", "mouseup", "resize", "scroll", "selectstart", "touchend", "touchmove", "touchstart", "wheel"] |
Confusing with the option field? Try edit tool here!
Following is the DOM structure that Scrollbar generated:
<scrollbar>
<article class="scroll-content">
your contents here...
</article>
<aside class="scrollbar-track scrollbar-track-x">
<div class="scrollbar-thumb scrollbar-thumb-x"></div>
</aside>
<aside class="scrollbar-track scrollbar-track-y">
<div class="scrollbar-thumb scrollbar-thumb-y"></div>
</aside>
</scrollbar>
Details here.
ignoreEvents support.scrollTo method.MIT.
FAQs
Customize scrollbar in modern browsers with smooth scrolling experience.
The npm package smooth-scrollbar receives a total of 9,377 weekly downloads. As such, smooth-scrollbar popularity was classified as popular.
We found that smooth-scrollbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.