# LinearProgressIndicator

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

## API Reference

### LinearProgressIndicator

> Source set: Android

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

#### Parameters

| | |
| --- | --- |
| progress | 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 | the [Modifier](https://composables.com/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier/api.md) to be applied to this indicator |
| color | the [Color](https://composables.com/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color/api.md) of the progress line |
| trackColor | the [Color](https://composables.com/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color/api.md) 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](https://composables.com/jetpack-compose/androidx.xr.glimmer/glimmer/composable-functions/surface/api.md). |
| gapSize | the visible gap between the progress line and the track |

### LinearProgressIndicator

> Source set: Android

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

#### Parameters

| | |
| --- | --- |
| modifier | the [Modifier](https://composables.com/jetpack-compose/androidx.compose.ui/ui/interfaces/Modifier/api.md) to be applied to this indicator |
| color | the [Color](https://composables.com/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color/api.md) of the moving progress lines |
| trackColor | the [Color](https://composables.com/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color/api.md) of the track behind the progress lines. If `Color.Unspecified`, uses a less prominent shade of the content color provided by the nearest [surface](https://composables.com/jetpack-compose/androidx.xr.glimmer/glimmer/composable-functions/surface/api.md). |
| gapSize | the visible gap between the progress lines and the track |

## Code Examples

### LinearProgressIndicatorSample

```kotlin
@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

```kotlin
@Sampled
@Composable
fun IndeterminateLinearProgressIndicatorSample() {
    LinearProgressIndicator()
}
```
