# Animating visibility vs alpha in Compose

DevFeed: [Animating visibility vs alpha in Compose](<https://devfeed.tech/articles/animating-visibility-vs-alpha-in-compose-22647.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/animatedvisibility-animate-float-as-state-alpha-position>)

Author: james shvarts

Published: 2022-06-13T03:26:33Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [apis](<https://devfeed.tech/tags/apis.md>), [code](<https://devfeed.tech/tags/code.md>), [compose](<https://devfeed.tech/tags/compose.md>), [image](<https://devfeed.tech/tags/image.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [layout](<https://devfeed.tech/tags/layout.md>), [state](<https://devfeed.tech/tags/state.md>), [ui](<https://devfeed.tech/tags/ui.md>), [visibility](<https://devfeed.tech/tags/visibility.md>)

## AI overview

This tutorial compares AnimatedVisibility with animateFloatAsState in Jetpack Compose. It explains that AnimatedVisibility can change the layout when content enters or leaves the composition, while keeping content in the composition and animating alpha can preserve the position of other elements.

## Source excerpt

Covers example when animateFloatAsState is what you need instead of AnimatedVisibility