AnimatedContent

constructor(targetState: T, transitionSpec: AnimatedContentTransitionScope<T>.() -> Unit = { enter = fadeIn() exit = fadeOut() }, contentKey: (T) -> Any? = { it }, contentPosition: ContentPosition = ContentPosition.TopStart, style: Style = Style, label: String = "AnimatedContent", content: ComponentScope.(T) -> Component?)

Parameters

targetState

The state whose content should currently be shown.

transitionSpec

Declares the transition via AnimatedContentTransitionScope.enter / AnimatedContentTransitionScope.exit. Defaults to a cross-fade.

contentKey

Identity for a state's content; reusing a key does not animate.

contentPosition

Alignment of overlapping content.

style

Style applied to the container.

label

Debug label for the underlying transitions.

content

Builder for the content of a given state.