<h2 id="infiniterepeatable-animation-repeatmode-initialstartoffset">infiniteRepeatable</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
public fun <T> infiniteRepeatable(
    animation: DurationBasedAnimationSpec<T>,
    repeatMode: RepeatMode = RepeatMode.Restart,
    initialStartOffset: StartOffset = StartOffset(0),
): InfiniteRepeatableSpec<T>
```

Creates a [InfiniteRepeatableSpec](/jetpack-compose/androidx.compose.animation/animation-core/classes/InfiniteRepeatableSpec) that plays a [DurationBasedAnimationSpec](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/DurationBasedAnimationSpec) (e.g. [TweenSpec](/jetpack-compose/androidx.compose.animation/animation-core/classes/TweenSpec),
[KeyframesSpec](/jetpack-compose/androidx.compose.animation/animation-core/classes/KeyframesSpec)) infinite amount of iterations.

For non-infinitely repeating animations, consider [repeatable](/jetpack-compose/androidx.compose.animation/animation-core/functions/repeatable).

`initialStartOffset` can be used to either delay the start of the animation or to fast forward
the animation to a given play time. This start offset will **not** be repeated, whereas the delay
in the [animation](/jetpack-compose/androidx.compose.animation/animation-core/interfaces/Animation) (if any) will be repeated. By default, the amount of offset is 0.

#### Parameters

| | |
| --- | --- |
| animation | animation that will be repeated |
| repeatMode | whether animation should repeat by starting from the beginning (i.e. [RepeatMode.Restart](/jetpack-compose/androidx.compose.animation/animation-core/classes/RepeatMode.Restart)) or from the end (i.e. [RepeatMode.Reverse](/jetpack-compose/androidx.compose.animation/animation-core/classes/RepeatMode.Reverse)) |
| initialStartOffset | offsets the start of the animation |

<div class='sourceset sourceset-common'>Common</div>

> **Deprecated** This method has been deprecated in favor of the infinite repeatable function that accepts start offset.

<hr class="docs-overload-divider">

<h2 id="infiniterepeatable-animation-repeatmode">infiniteRepeatable</h2>

```kotlin
public fun <T> infiniteRepeatable(
    animation: DurationBasedAnimationSpec<T>,
    repeatMode: RepeatMode = RepeatMode.Restart,
): InfiniteRepeatableSpec<T>
```