Composable Component

LoadingIndicator

A Material Design loading indicator.

LoadingIndicator social preview

LoadingIndicator

Common
@ExperimentalMaterial3ExpressiveApi
@Composable
fun LoadingIndicator(
    progress: () -> Float,
    modifier: Modifier = Modifier,
    color: Color = LoadingIndicatorDefaults.indicatorColor,
    polygons: List<RoundedPolygon> = LoadingIndicatorDefaults.DeterminateIndicatorPolygons,
) =
    LoadingIndicatorImpl(
        progress = progress,
        modifier = modifier,
        containerColor = Color.Unspecified,
        indicatorColor = color,
        containerShape = LoadingIndicatorDefaults.containerShape,
        indicatorPolygons = polygons,
    )

Parameters

progress the progress of this loading indicator, where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced into the range. The indicator will morph its shapes between the provided polygons according to the value of the progress.
modifier the Modifier to be applied to this loading indicator
color the loading indicator's color
polygons a list of RoundedPolygons for the sequence of shapes this loading indicator will morph between as it progresses from 0.0 to 1.0. The loading indicator expects at least two items in that list.

LoadingIndicator

Common
@ExperimentalMaterial3ExpressiveApi
@Composable
fun LoadingIndicator(
    modifier: Modifier = Modifier,
    color: Color = LoadingIndicatorDefaults.indicatorColor,
    polygons: List<RoundedPolygon> = LoadingIndicatorDefaults.IndeterminateIndicatorPolygons,
) =
    LoadingIndicatorImpl(
        modifier = modifier,
        containerColor = Color.Unspecified,
        indicatorColor = color,
        containerShape = LoadingIndicatorDefaults.containerShape,
        indicatorPolygons = polygons,
    )

Parameters

modifier the Modifier to be applied to this loading indicator
color the loading indicator's color
polygons a list of RoundedPolygons for the sequence of shapes this loading indicator will morph between. The loading indicator expects at least two items in that list.