---
title: "DeferredTransitionState"
description: "A TransitionState that supports a deferred phase before the automatic transition begins."
type: "class"
lastmod: "2026-05-20T01:13:52.933475Z"
---
## API Reference

> Source set: Common

```kotlin
@ExperimentalDeferredTransitionApi
public class DeferredTransitionState<S>(initialState: S) : TransitionState<S>()
```

A [TransitionState](/jetpack-compose/androidx.compose.animation/animation-core/classes/TransitionState) that supports a deferred phase before the automatic transition begins.

This state is designed for scenarios where a transition should be held in an intermediate,
manually-controlled state (e.g., during a predictive back gesture) before proceeding to its final
target.

While in the deferred phase (initiated by [defer](#defer)), the transition holds the new target as a
[pendingTargetState](#pendingtargetstate). The actual `targetState` remains unchanged, keeping the transition in its
current visual state. Once [animateTo](/jetpack-compose/androidx.compose.animation/animation-core/functions/animateTo) is called, the [pendingTargetState](#pendingtargetstate) is cleared and the
transition proceeds to the new `targetState`, triggering its automatic animations.

#### Parameters

| | |
| --- | --- |
| initialState | The initial state of the transition. |

## Properties

### pendingTargetState

> Source set: Common

```kotlin
public var pendingTargetState: S?
```

The target state that the transition will eventually animate to once the deferred phase ends.

This value is set when [defer](#defer) is called and cleared when [animateTo](/jetpack-compose/androidx.compose.animation/animation-core/functions/animateTo) is called, at which
point `targetState` will be updated to the new state.

## Functions

### defer

```kotlin
public fun defer(targetState: S)
```

Updates the [pendingTargetState](#pendingtargetstate) and initiates the deferred phase.

During this phase, the transition's `targetState` remains unchanged, keeping the transition
in its current visual state. However, the new target is exposed via [pendingTargetState](#pendingtargetstate),
signaling to transition-aware components that a state change is pending. They can then use
this information to perform early setup or apply custom logic for the pending state before
the automatic transition is eventually started via [animateTo](/jetpack-compose/androidx.compose.animation/animation-core/functions/animateTo).

If [defer](#defer) is called while an animation is already in progress (i.e., [currentState](/jetpack-compose/androidx.glance/glance/composable-functions/currentState) !=
`targetState`), the animation will continue toward its current `targetState` while
[pendingTargetState](#pendingtargetstate) is set. This allows components to respond to the pending state early,
potentially concurrently with the ongoing animation.

#### Parameters

| | |
| --- | --- |
| targetState | The state the transition should eventually animate to. |

### animateTo

```kotlin
public fun animateTo(targetState: S)
```

Clears the [pendingTargetState](#pendingtargetstate) and updates the `targetState` to the provided `targetState`,
ending the deferred phase and starting the automatic transition animation.

Note: The `targetState` provided here does not need to match the previous
[pendingTargetState](#pendingtargetstate). If a different state is provided, the transition will animate directly
to this new state, bypassing the previously deferred target.

#### Parameters

| | |
| --- | --- |
| targetState | The final target state for the transition. |
