GridLayout for Compose is a library that provides missing non lazy grid layout composables for Compose Multiplatform.
Jetpack Compose doesn't offer non lazy grid layout, there are only lazy grid layout and alternatives (for example, flow layout). But sometimes, we need to use grid layout for less complexity and more intuitive layout code. This library can be simpler solution for small grid UI.
There are benefits of this library:
To download this library, add dependency to your gradle:
dependencies {
implementation("com.cheonjaeung.compose.grid:grid:<version>")
}
After the 2.0.0 version, the group id and package name is changed from
io.woong.compose.grid
to com.cheonjaeung.compose.grid
.
VerticalGrid(
columns = SimpleGridCells.Fixed(3),
modifier = Modifier.fillMaxWidth(),
) {
for ((index, color) in colors.withIndex()) {
ColorBox(
modifier = Modifier,
color = color,
text = (index + 1).toString(),
)
}
}
For more information, please visit documentation site.
Please see changelog file.
Copyright 2023 Jaeung Cheon.
GridLayout for Compose is licensed under Apache License 2.0. See license file for more details.