Skip to content
Discussion options

You must be logged in to vote

Lenis's overscroll option isn't a bounce effect. It works like CSS overscroll-behavior: it only decides whether a nested Lenis instance (one whose wrapper isn't window) passes the scroll on to its parent when it reaches an edge (lenis.ts L558-L570). On the page itself, scrollTo clamps the target to [0, limit] (L854), so it can never scroll past the bottom and spring back.

For auto-navigation, you can listen to virtual-scroll. It keeps firing at the edge, so you can add up how far the user keeps pulling:

const lenis = new Lenis({ autoRaf: true })
let pull = 0

lenis.on('virtual-scroll', ({ deltaY }) => {
  const atBottom = lenis.limit - lenis.scroll < 1
  if (atBottom && deltaY > 0) {
    p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mig-hub
Comment options

Answer selected by mig-hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants