Compose Modifier

horizontalScroll

Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow.

HorizontalScrollSample

@Composable
fun HorizontalScrollSample() {
    val scrollState = rememberScrollState()
    val gradient =
        Brush.horizontalGradient(
            listOf(Color.Red, Color.Blue, Color.Green),
            0.0f,
            10000.0f,
            TileMode.Repeated,
        )
    Box(
        Modifier.horizontalScroll(scrollState)
            .size(width = 10000.dp, height = 200.dp)
            .background(brush = gradient)
    )
}