Jetpack Compose Bottom Border

May 6, 2022
val borderSize = 1.dp
val borderColor = Color.DarkGray

Box(modifier = Modifier
    .fillMaxWidth()
    .background(color = Color.LightGray)
    .drawBehind {
        val strokeWidth = borderSize * density
        val y = size.height - strokeWidth / 2

        drawLine(
            borderColor,
            Offset(0f, y),
            Offset(size.width, y),
            strokeWidth
        )
    },
)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.