Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.


Smart, lightweight functions to animate browser scroll.

  • Scroll the page or a specific element.
  • Scroll vertically and horizontally.
  • Scroll to a target element or an arbitrary position, with an optional offset.
  • Scroll animations can be interrupted by the user or other scripts (no “fighting” animations).
  • Scroll animations adapt to a moving target; handy when loading affects layout.
  • Intuitive easeInOutCubic animation timing; a soft acceleration and deceleration.
  • < 1 kB bundle size, tested.
  • SSR friendly.


For Node.js, to install scroll-animator with npm, run:

npm install scroll-animator

For Deno and browsers, an example import map:

  "imports": {
    "scroll-animator/": ""


Supported runtime environments:

Consider polyfilling:

Non Deno projects must configure TypeScript to use types from the ECMAScript modules that have a // @ts-check comment:


The npm package scroll-animator features optimal JavaScript module design. It doesn’t have a main index module, so use deep imports from the ECMAScript modules that are exported via the package.json field exports: