better-scroll is a JavaScript library that provides smooth, customizable scrolling behavior for web pages, particularly on mobile devices. Standard browser scrolling can feel sluggish or behave inconsistently on mobile, and better-scroll solves this by implementing its own scroll engine that gives developers fine-grained control over how content scrolls. It is inspired by iscroll (an earlier library with the same goal) and extends it with additional features and better performance. The core concept is simple: you have a fixed-height outer container (the "wrapper") and inner content that is taller than that container. better-scroll detects the overflow and handles touch events, momentum, and animations to make scrolling feel natural. The README walks through the basic setup with HTML and JavaScript examples, you point better-scroll at the outer wrapper element, and it takes over scrolling for the first child element inside it. From there, you can add plugins for specific behaviors: pull-to-refresh, infinite scroll (loading more items as the user approaches the bottom), zoom, and more. The library is written in TypeScript, has no dependencies (no framework required), and can be used with plain JavaScript or alongside UI frameworks. It supports both mobile and desktop browsers. It is installed via npm (npm install better-scroll) or loaded from a CDN for simpler setups. A lightweight core-only package is also available if you don't need the full plugin suite.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.