nesyou01 / LazyStaggeredGrid

A Jetpack Compose library to achieve staggered grid view
51 stars 2 forks source link
android jetpack jetpack-android jetpack-compose kotlin kotlin-android

LazyStaggeredGrid

A Jetpack Compose library to achieve staggered grid view

Getting Started

To start using this package, add the JitPack repository to your settings.gradle file

maven { url 'https://jitpack.io' }

Then add the dependency

  implementation 'com.github.nesyou01:LazyStaggeredGrid:<latest-version>'

Features

Simple Example

LazyStaggeredGrid(cells = StaggeredCells.Adaptive(minSize = 180.dp)) {
     items(60) {
        val random: Double = 100 + Math.random() * (500 - 100)
          Image(
             painter = painterResource(id = R.drawable.image),
             contentDescription = null,
             modifier = Modifier.height(random.dp).padding(10.dp),
             contentScale = ContentScale.Crop
          )
      }
  }

Result

The result of the code above:

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page.

Buy me a coffe

"Buy Me A Coffee"