Jetpack Compose: LottieSwipeRefreshIndicator


Simplest way to use Lottie Files as a SwipeRefreshLayout

Just a quick note, here is how to use CustomSwipeRefresh in accompanist using LottieRefreshIndicator

Use it in coordination with accompanist swipe refresh

Be sure to add this library in the build.gralde

implementation “”

var loading by viewModel.loading.collectAsState() //observerAsState for livedata

state = rememberSwipeRefreshState(isRefreshing = !loading),
onRefresh = {
indicator = { state, trigger ->
LottieRefreshIndicator(state = state, refreshTriggerDistance = trigger, animation = R.raw.monitor_progress)
) {

Here is the LottieRefreshIndicator file:

Visit the example here at