Evolpagink
Jetpack/Compose Multiplatform paging small, fast, easy, customizable, kotlin flow based, and also platform agnostic. Compose web sample⬇️
Install / Use
/learn @nxoim/EvolpaginkREADME
evolpagink
Pagination made truly small, truly easy to use. The evil, unknown counterpart of... uhm.. some other commonly used pagination library.
// for compose multiplatform or jetpack compose
com.nxoim.evolpagink:compose:<version>
// for diy bindings. core is not bound to any ui framework
com.nxoim.evolpagink:core:<version>
how small?
First of all - the amount of source code is small.
But regarding the amount of boilerplate - you define your pageable source:
val pageable = pageable(
coroutineScope,
onPage = { index ->
yourSource.getPage(index)
// getPage is Flow<List<YourItem>>
},
strategy = prefetchPageAmount(
// this strategy will use your ui to fetch
// items to fill the viewport + prefetch
// specified amount beyond viewport
initialPage = 0,
pageAmountSurroundingVisible = 2
)
)
Aaaaaand then you use it. For example in compose it looks like:
val lazyListState = rememberLazyListState()
val pageableState = yourModel.pageable.toState(
lazyListState,
key = { item -> item.maybeSomeId }
)
LazyColumn(state) {
// this is an overload that automatically
// uses the key lambda from above
items(pageableState) { item ->
YourItem(item)
}
// by the way the overload prevents the
// import fights of items(count: Int)
// vs items(items: List<T>)!!
}
fast?
Theres a microbenchmark in the repository. Clone the repo and run it. If you find the benchmark unsatisfactory - i'd very much appreciate a discussion in an open issue!
customizable?
Yes. If you are unsatisfied with any of the stategies for fetching and prefetching items - you can easily create your own by implementing 'PageFetchStrategy'. You can tailor the behavior precisely.
what else?
- evolpagink is Compose Multiplatform first, but the core logic being platform agnostic leaves room for compatibility with other UI frameworks.
- If the library becomes unmaintained - forking and maintaining it yourself should be easy due to the small size and code being mostly self documenting.
Contributions
To contribute:
- First open an issue and describe your contribution so it can be discussed
- Then link the branch of your fork, containing the contribution, in the issue
- And then the contribution may be merged
Credits
Kudos to the Tiler project for being an inspiration and for the benchmark
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
