

Install via npm npm i smooth-smooth-scrollĢ. URL doesn't change, but, on the other hand, you can make any element a link.Some people may complain about accessibility.You cannot set up easing for scroll animation.There is no a proper way to know when the scroll event is finished.It may be useful just for small adjustments, but the most obvious use case is to prevent content overlap with a fixed header

The same thing works with horizontal scrolling or even with both at the same timeĪnd the last but one of the most essential features of the package is the ability to set an offset for scroll.So, let's just say, if you have some element on your page, you can set either it's going to be at the top edge of the screen, at center, or the bottom edge after scroll There is a way to choose the position of the destination element.If the scroll event has already started it can be easily stoped before the end.You will not have any problems if you start clicking on the smooth-scroll trigger button as crazy.It has good performance without weird jankiness and other bugs.

It's built with scrollIntoView what gives a lot of advantages other smooth-scroll packages don't have: You can change parameters of scroll after the first activation with a bit of js and easily add new links Works in all alive browsers (requires 4.1 KB of polyfills) It's especially useful if you have some fixed elements and want to correct the scroll destination. That's a simple to use realization of a smooth scroll for your website.
