Compose Component

LinearProgressIndicator

A determinate linear progress indicator that shows how far a process has advanced.

LinearProgressIndicatorSample

@Sampled
@Composable
fun LinearProgressIndicatorSample() {
    val progress = 0.5f

    // Animate progress changes, as the indicator doesn't animate between values.
    val animatedProgress by animateFloatAsState(targetValue = progress)
    LinearProgressIndicator(progress = { animatedProgress })
}

IndeterminateLinearProgressIndicatorSample

@Sampled
@Composable
fun IndeterminateLinearProgressIndicatorSample() {
    LinearProgressIndicator()
}
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: