> Documentation index: https://developer.android.com/reference/llms.txt

# LinearProgressIndicator

## Functions summary

|---|---|
| `Unit` | `@Composable LinearProgressIndicator( modifier: Modifier, color: Color, trackColor: Color, gapSize: Dp )` An indeterminate linear progress indicator that shows that a process is ongoing, without indicating how far it has advanced. |
| `Unit` | `@Composable LinearProgressIndicator( progress: () -> Float, modifier: Modifier, color: Color, trackColor: Color, gapSize: Dp )` A determinate linear progress indicator that shows how far a process has advanced. |

## Functions

### LinearProgressIndicator

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/LinearProgressIndicator.kt+function:LinearProgressIndicator) Added in [1.0.0-alpha23](https://developer.android.com/jetpack/androidx/releases/xr-glimmer.md.txt#1.0.0-alpha23)

```
@Composable
fun LinearProgressIndicator(
    modifier: Modifier = Modifier,
    color: Color = LinearProgressIndicatorDefaults.color,
    trackColor: Color = Color.Unspecified,
    gapSize: Dp = LinearProgressIndicatorDefaults.GapSize
): Unit
```

An indeterminate linear progress indicator that shows that a process is ongoing, without indicating how far it has advanced.

The indicator's height sets the thickness of the progress lines and the track.

```kotlin
import androidx.xr.glimmer.LinearProgressIndicator

LinearProgressIndicator()
```

| Parameters |
|---|---|
| `modifier: Modifier = Modifier` | the `Modifier` to be applied to this indicator |
| `color: Color = LinearProgressIndicatorDefaults.color` | the `Color` of the moving progress lines |
| `trackColor: Color = Color.Unspecified` | the `Color` of the track behind the progress lines. If `Color.Unspecified`, uses a less prominent shade of the content color provided by the nearest `surface`. |
| `gapSize: Dp = LinearProgressIndicatorDefaults.GapSize` | the visible gap between the progress lines and the track |

### LinearProgressIndicator

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/LinearProgressIndicator.kt+function:LinearProgressIndicator) Added in [1.0.0-alpha23](https://developer.android.com/jetpack/androidx/releases/xr-glimmer.md.txt#1.0.0-alpha23)

```
@Composable
fun LinearProgressIndicator(
    progress: () -> Float,
    modifier: Modifier = Modifier,
    color: Color = LinearProgressIndicatorDefaults.color,
    trackColor: Color = Color.Unspecified,
    gapSize: Dp = LinearProgressIndicatorDefaults.GapSize
): Unit
```

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

The indicator's height sets the thickness of the progress line and the track. There is no animation between `progress` values; animate the value before passing it in if needed.

```kotlin
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.runtime.getValue
import androidx.xr.glimmer.LinearProgressIndicator

val progress = 0.5f

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

| Parameters |
|---|---|
| `progress: () -> Float` | the progress of this indicator, where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced into the range |
| `modifier: Modifier = Modifier` | the `Modifier` to be applied to this indicator |
| `color: Color = LinearProgressIndicatorDefaults.color` | the `Color` of the progress line |
| `trackColor: Color = Color.Unspecified` | the `Color` of the track that the progress line hasn't reached yet. If `Color.Unspecified`, uses a less prominent shade of the content color provided by the nearest `surface`. |
| `gapSize: Dp = LinearProgressIndicatorDefaults.GapSize` | the visible gap between the progress line and the track |