State of Compose 2023 results are in! Click here to learn more

← Back to Material Compose

CircularProgressIndicator

Component
in
Material
. Since 0.1.0-dev15

Overview

Code Examples

Determinate <a href="https://material.io/components/progress-indicators#circular-progress-indicators" class="external" target="_blank">Material Design circular progress indicator</a>.

Progress indicators express an unspecified wait time or display the length of a process.

!Circular progress indicator image(https://developer.android.com/images/reference/androidx/compose/material/circular-progress-indicator.png)

By default there is no animation between progress values. You can use ProgressIndicatorDefaults.ProgressAnimationSpec as the default recommended AnimationSpec when animating progress, such as in the following example:

Overloads

CircularProgressIndicator

@Composable
fun CircularProgressIndicator(
    @FloatRange(from = 0.0, to = 1.0)
    progress: Float,
    modifier: Modifier = Modifier,
    color: Color = MaterialTheme.colors.primary,
    strokeWidth: Dp = ProgressIndicatorDefaults.StrokeWidth,
    backgroundColor: Color = Color.Transparent,
    strokeCap: StrokeCap = StrokeCap.Butt,
)

Parameters

NameDescription
progressThe progress of this progress indicator, where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced into the range.
modifierthe Modifier to be applied to this progress indicator
colorThe color of the progress indicator.
strokeWidthThe stroke width for the progress indicator.
backgroundColorThe color of the background behind the indicator, visible when the progress has not reached that area of the overall indicator yet.
strokeCapstroke cap to use for the ends of this progress indicato

CircularProgressIndicator

@Composable
fun CircularProgressIndicator(
    modifier: Modifier = Modifier,
    color: Color = MaterialTheme.colors.primary,
    strokeWidth: Dp = ProgressIndicatorDefaults.StrokeWidth,
    backgroundColor: Color = Color.Transparent,
    strokeCap: StrokeCap = StrokeCap.Square,
)

Parameters

NameDescription
modifierthe Modifier to be applied to this progress indicator
colorThe color of the progress indicator.
strokeWidthThe stroke width for the progress indicator.
backgroundColorThe color of the background behind the indicator, visible when the progress has not reached that area of the overall indicator yet.
strokeCapstroke cap to use for the ends of this progress indicato