How to create vertical dividers with Jetpack Compose? I try to use Spacer and Box to do it, but it doesn't show up at all. Here is what i tried:
Box(
modifier = Modifier
.fillMaxHeight()
.width(2.dp)
.background(color = Color.Black)
)
But that doesn't work at all. So how to do vertical divider in Jetpack Compose?
You can use the
Divider
composable with thewidth(xx.dp)
modifier applying an intrinsic measurements to its parent container.Something like:
As explained in the doc: