<div class='type'>Composable Function</div>


<a id='references'></a>



<h2 id="remembertransition-transitionstate-label">rememberTransition</h2>

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


```kotlin
@Composable
public fun <T> rememberTransition(
    transitionState: TransitionState<T>,
    label: String? = null,
): Transition<T>
```


Creates a `Transition` and puts it in the `currentState` of the
provided `transitionState`. If the `TransitionState.targetState` changes, the `Transition` will
change where it will animate to.

__Remember__: The provided `transitionState` needs to be `remember`ed.

Compared to `updateTransition` that takes a targetState, this function supports a different
initial state than the first targetState. Here is an example:


In most cases, it is recommended to reuse the same `transitionState` that is `remember`ed, such
that `Transition` preserves continuity when `targetState` is
changed. However, in some rare cases it is more critical to immediately *snap* to a state change
(e.g. in response to a user interaction). This can be achieved by creating a new
`transitionState`: