VOOZH about

URL: https://www.geeksforgeeks.org/kotlin/staggered-gridview-in-android-using-jetpack-compose/

⇱ Staggered GridView in Android using Jetpack Compose - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Staggered GridView in Android using Jetpack Compose

Last Updated : 23 Jul, 2025

Staggered Grid View has been seen in most applications such as Pinterest in which each item of gridview takes its own height and aligns within the grid view according to that. In this article, we will look at how to implement Staggered Grid View in Android using Jetpack Compose

Step by Step Implementation

Step 1 : Create a New Project in Android Studio

To create a new project in the Android Studio, please refer to How to Create a new Project in Android Studio with Jetpack Compose.

Note: Select Kotlin as the programming language.

Step 2 : Adding images to the drawable folder

Copy all the images which you want to add to your grid view. Navigate to app > res > drawable. Right-click on it and paste all the images into the drawable folder.

Step 3 : Working with the MainActivity.kt file

Go to the MainActivity.kt file and refer to the following code. Below is the code for the MainActivity.kt file. Comments are added inside the code to understand the code in more detail.

MainActivity.kt:

Output:

Comment
Article Tags:

Explore