Lenis

~7kb gzipped

Lightweight smooth scroll powering modern marketing sites.


01

See It in Action

Each demo drives a custom scrollable container with Lenis -- feel the eased scroll and see the programmatic control CSS cannot match.

Scroll through the sections and toggle Lenis on/off to feel the difference. CSS scroll is instantaneous; Lenis interpolates every wheel tick into a smooth glide.

Preview

02

What is Lenis?

Lenis is a ~7kb library that replaces the browser's default scroll with a smoothed, interpolated one. When a user spins the wheel or flicks the trackpad, Lenis eases the scroll position toward the target instead of jumping -- the result is the buttery glide you see on Awwwards-winning sites and modern product pages.

Beyond feel, Lenis gives you a full API: scrollTo with custom duration and easing, a scroll event that fires on every smoothed frame (perfect for driving parallax or GSAP ScrollTrigger), and native support for prefers-reduced-motion. It's framework-agnostic and ships with no runtime dependencies.

🌊
Eased Scroll Interpolation
Every wheel tick and trackpad gesture is smoothed into a continuous glide. Native browser scroll jumps -- Lenis interpolates.
🎯
Programmatic scrollTo
Call lenis.scrollTo(target, { duration, easing }) to animate to any element or position with custom timing -- something CSS scroll-behavior cannot do.
🔌
Pairs With Any Animator
Subscribe to lenis.on('scroll', ...) to drive parallax, GSAP ScrollTrigger, or anything else off a single smoothed scroll value.

03

When to Use Lenis

Use when
Marketing landing pages that want a more 'designed' scroll feel
Portfolio and case-study sites (Awwwards-style)
Product launch pages with scroll-linked animations
Scroll-based storytelling and long-form narrative sites
Sticky-section parallax heroes driven by the scroll position
Avoid when
Apps and dashboards where users expect native scroll (docs, admin panels)
Accessibility-critical flows -- custom scroll can interfere with assistive tech
Long-form reading content (news, blogs) -- eased scrolling can feel sluggish

04

How Lenis Compares

Lenis vs Native CSS scroll-behavior: smooth

CSS smooth scroll jumps to an anchor with no duration or easing control -- the browser picks the timing. Lenis gives you full control over duration, easing curves, and the programmatic API.

Lenis wins at
Custom duration and easing, scrollTo by element or position, pause/resume, respects prefers-reduced-motion, smooth wheel interpolation (not just anchor jumps)
Native CSS scroll-behavior: smooth wins at
Zero JS, works everywhere by default, no library to load, perfect for simple anchor scrolling
Lenis vs Locomotive Scroll

Locomotive is now built on top of Lenis as of v5. If you want data-attribute parallax and in-view class toggles, use Locomotive. For just smooth scroll, use Lenis directly and skip the wrapper.

Lenis wins at
Smaller bundle, simpler API, the underlying engine Locomotive itself uses, direct control over scroll loop
Locomotive Scroll wins at
Declarative HTML data-attributes for parallax/in-view, batteries-included feature set
Lenis vs GSAP ScrollSmoother

ScrollSmoother is a Club GreenSock (paid) plugin. Lenis is MIT-licensed and free forever. Both handle smooth scroll; Lenis has become the default in the Awwwards/Club GSAP scene anyway.

Lenis wins at
Free and MIT, smaller bundle, framework-agnostic, independent of GSAP ecosystem
GSAP ScrollSmoother wins at
Deeper integration with GSAP timelines, official support from GreenSock, tighter ScrollTrigger sync out of the box

05

Get Started with Lenis

Terminal
npm install lenis
Terminal
yarn add lenis
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/lenis.min.js"></script>
Quick Start
import Lenis from "lenis";

// Smooth-scroll the whole page -- autoRaf runs the animation loop for you
const lenis = new Lenis({ autoRaf: true });

// Programmatic scroll to any element, with custom duration + easing
document.querySelector("#to-pricing").addEventListener("click", () => {
  lenis.scrollTo("#pricing", {
    duration: 1.2,
    easing: (t) => 1 - Math.pow(1 - t, 3)   // easeOutCubic
  });
});

// Subscribe to every smoothed scroll frame -- great for parallax / GSAP
lenis.on("scroll", ({ scroll }) => {
  // Apply transforms based on the scroll value
});

06

Related Libraries