r/Kotlin • u/Its-Amaaboiz • 15d ago
Compose Fast Scrollbar: a draggable scrollbar for lazy lists in Compose Multiplatform
Hi r/Kotlin, I created a CMP scrollbar with an easy-to-use API.
Compose has no draggable scrollbar for lazy lists on Android or iOS (desktop has one, but it's desktop-only). I wanted one in shared UI, so I made a library for it.
LazyColumn(
state = listState,
modifier = Modifier.scrollbar(listState),
) { ... }
One modifier in commonMain, works on Android, iOS and desktop:
→ LazyColumn, LazyRow and both lazy grids
→ label bubble while dragging (month, letter, section)
→ handles infinite feeds: pages loading mid-drag keep the thumb under your finger
→ no recompositions while scrolling or dragging
→ per-platform styles from shared code, no expect/actual needed
I published it on Maven Central, and it needs Compose Multiplatform 1.10+.
GitHub: https://github.com/Amaanprobably/compose-fast-scrollbar
I also wrote an easy-to-follow guide with short videos: https://github.com/Amaanprobably/compose-fast-scrollbar/blob/master/GUIDE.md
It's my first library, so feedback is welcome, especially from anyone building with KMP/CMP.