lenis
Smooth scroll as it should be
A lightweight JavaScript library that adds smooth, inertia-based scrolling to any website, with easy integrations for React, Vue, Framer, and GSAP so scroll-driven animations stay perfectly in sync.
Lenis is a small JavaScript library that makes scrolling on websites feel smoother. When you scroll a normal webpage, the movement is instant and can feel mechanical. Lenis intercepts that scrolling and adds a gentle inertia, so the page glides to a stop rather than cutting off abruptly. The name comes from the Latin word for smooth.
The library is designed to be lightweight and to perform well on modern browsers. It works well alongside other animation tools. The README shows an example of connecting it with GSAP, a popular animation library, so that scroll-driven effects like parallax sections or element reveals stay in sync with Lenis's custom scroll position. It is also commonly used on creative or portfolio-style websites that include WebGL effects.
Getting started is straightforward. For a basic setup you can drop two lines into any HTML page without needing a build tool at all: one line loads the stylesheet and another loads the script, then a single line of JavaScript turns smooth scrolling on. For more complex projects, Lenis is available as a package through npm and has dedicated integrations for React, Vue, and Framer. There is also a snap package that adds scroll snapping behavior.
The settings let you tune the feel of the scroll, control how nested scrollable areas behave, handle anchor link clicks, and configure automatic resizing. Events are emitted on each scroll frame, which makes it straightforward to synchronize other animations or track scroll progress.
The project is sponsored by several studios and individuals and is part of Vercel's open-source program. It is maintained by the design and development studio darkroom.engineering. The full README is longer than what was shown.
Where it fits
- Add buttery smooth inertia scrolling to a portfolio or creative website with two lines of JavaScript and no build tool required.
- Sync GSAP scroll-triggered animations, parallax sections, element reveals, with Lenis's custom scroll position so they stay in perfect sync.
- Build a React portfolio with smooth scrolling by installing the Lenis npm package and wrapping the layout component.
- Create a scroll-snapping one-page site with full-height sections using Lenis's snap add-on package.