talira

Lightweight smooth-scroll library that runs on the browser's native scroll

open sourceMITfree

Lenis is darkroom.engineering's MIT-licensed smooth scroll library for the web: a few kilobytes with no runtime dependencies. It wraps the browser's own scroll, so position: sticky, anchor links and accessibility keep working, and handles vertical, horizontal and nested scrolling from one instance. It's built to drive WebGL scroll scenes, parallax and GSAP ScrollTrigger off one loop, with adapter packages for React, Vue and Framer and a snap plugin for scroll snapping. It installs from npm as lenis.

Problems it solves

  • add smooth scrolling to my website without breaking sticky elements
  • sync scroll-driven WebGL or parallax animations with the page scroll
  • smooth scroll in a React or Vue site

Features

  • smooth scroll on top of native scrolling
  • vertical, horizontal and nested scrolling
  • sync with WebGL scenes and GSAP ScrollTrigger
  • React, Vue and Framer adapters
  • snap plugin

Limitations

  • It doesn't support CSS scroll-snap (use its snap plugin), is capped at 60fps on Safari, and stops over iframes, which don't forward wheel events.1

Alternatives

The same job

These do what Lenis does.

  1. ScrollMagic Lightweight library for scroll-driven interactions and events

Compare Lenis with the top 3