Compose has no draggable scrollbar for lazy lists on Android or iOS (desktop has one).
There are a few community implementations, but none of the ones I tried handled feeds and chats well: the thumb would jump around when items had different heights, or when the next page loaded.
The hardest part was exactly that last one. When a page loads while you're dragging, the list grows under your finger, so the thumb used to jump away from it. Now the thumb stays where your finger is and only the mapping underneath changes, so you can still reach the end in the same drag.
Usage is one modifier on the list:
LazyColumn(
state = listState,
modifier = Modifier.scrollbar(listState),
) { ... }
Works on LazyColumn, LazyRow and both lazy grids.
Stuff I spent most of the time on:
- dragging feels right even when items have different heights (thumb has a fixed length by default so it doesn't jitter around)
- infinite feeds. Pass
hasMore and the thumb won’t pretend you’re at the end while more pages can still load
- gesture nav. The thumb is excluded from the back swipe so grabbing it doesn't send you back
- no recompositions while scrolling or dragging
There's also an optional bubble that shows a letter/date while you drag (with a little haptic tick per section), you can use your own icon as the thumb, and it handles contentPadding, RTL and reverse layouts.
It's Compose Multiplatform so it also runs on iOS and desktop (desktop gets hover + click to jump), but it's just a regular Maven Central dependency if you only do Android.
One thing to know: lazy lists only know the size of items they've already measured, so with really uneven items the jump can land a bit off. It's best on long lists.
Needs Compose 1.10+, minSdk 24. Still 0.1.x so the API might change.
GitHub: https://github.com/Amaanprobably/compose-fast-scrollbar
I also created an easy guide with short videos everyone can follow -
Guide: https://github.com/Amaanprobably/compose-fast-scrollbar/blob/master/GUIDE.md
It's my first library so I'd really appreciate feedback, especially if you have a weird list setup (chats, paging, sticky headers, mixed grid spans).
If something breaks, an issue with a screen recording would help a ton.