Compose Modifier

progressSemantics

Contains the semantics required for a determinate progress indicator or the progress part of a slider, that represents progress within valueRange.

DeterminateProgressSemanticsSample

@Sampled
@Composable
fun DeterminateProgressSemanticsSample() {
    val progress = 0.5f // emulate progress from some state
    Box(
        Modifier.progressSemantics(progress)
            .size((progress * 100).dp, 4.dp)
            .background(color = Color.Cyan)
    )
}

IndeterminateProgressSemanticsSample

@Sampled
@Composable
fun IndeterminateProgressSemanticsSample() {
    Box(Modifier.progressSemantics().background(color = Color.Cyan)) {
        Text("Operation is on progress")
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: