Jaimin Vashi
Jaimin Vashi

Reputation: 43

Jetpack Compose Vertical Staggered Grid with variable width

i am new to jetpack compose the dont know if this is achievable or not.

so i have a list of strings and i want to show them in a staggered grid where each item should be placed in the current row unless it doesn't fit then it should be placed in the next row.

if i try to do this with LazyVerticalStaggeredGrid the items are not variable in width so if a text has more characters then its height gets increased.

if i do this with LazyHorizontalStaggeredGrid the width of the item is fine but they go outside the view and makes the layout scrollable

how can i achieve this behaviour?

Upvotes: 0

Views: 1220

Answers (1)

Adrian K
Adrian K

Reputation: 4843

There is currently no lazy, i.e. RecyclerView style layout for this, but if you are dealing with a reasonable amount of items, it sounds like FlowRow is what you are looking for

Upvotes: 2

Related Questions