finds.dev← search

// the find

ustbhuangyi/better-scroll

★ 16,489 · TypeScript · MIT · updated Jun 2024

:scroll: inspired by iscroll, and it supports more features and has a better scroll perfermance

BetterScroll is a JavaScript library for custom scroll behavior on mobile web, originally a fork/reimagining of iScroll. It handles the cases where native overflow: scroll is too limited — carousels, pickers, pull-to-refresh, infinite scroll — without any framework dependency in the core. The audience is frontend developers building mobile-first web apps, particularly in the Vue ecosystem.

The plugin architecture is genuinely well-designed: a lean core package (@better-scroll/core) plus opt-in plugins means you don't ship slide/zoom/picker code to users who only need basic scrolling. The test coverage is real — each package has its own spec suite with mocks, not just a token test file. Nested scroll handling (the hardest problem in this space) gets its own dedicated plugin with a BScrollFamily abstraction that coordinates parent/child instances. Zero runtime dependencies on the core is a meaningful constraint they've actually kept.

The 1.x branch is abandoned with a migration path but no timeline, and the last commit was June 2024 — the project is in maintenance mode at best. The README's 'why can't I scroll' section hints at the real trap: you must precisely control the wrapper height, and BetterScroll silently does nothing if the content doesn't overflow, which wastes hours of debugging for new users. There's no React-native integration story and the react-examples package in the monorepo is clearly an afterthought. The infinity scroll plugin's DOM recycling approach is manual and callback-heavy — using it means writing your own virtual list logic rather than getting one out of the box.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →