Stay organized with collections
Save and categorize content based on your preferences.
androidx.compose.runtime.annotation
The androidx.compose.runtime.annotation package provides annotations used by the compiler and tooling. These annotations are published in a separate library to allow using these annotations in modules that do not depend on Compose Runtime, but may be used with Compose in other modules.
Annotates that a class should not be retained (i.e. used in the return type of the calculation lambda given to the retain {} method in androidx.compose.runtime).
FrequentlyChangingValue is used to denote properties and functions that return values that change frequently during runtime, and cause recompositions when they are read (for example, if they are backed with snapshot state).
RememberInComposition is used by an associated lint check to enforce that a marked constructor, function, or property getter is not called directly within composition.
Cmn
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[],[],null,["androidx.compose.runtime.annotation\nCommon/All\n\nThe `androidx.compose.runtime.annotation` package provides annotations used by the compiler and tooling. These annotations are published in a separate library to allow using these annotations in modules that do not depend on Compose Runtime, but may be used with Compose in other modules.\n\nAnnotations \n\n|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [DoNotRetain](/reference/kotlin/androidx/compose/runtime/annotation/DoNotRetain) | Annotates that a class should not be retained (i.e. used in the return type of the `calculation` lambda given to the `retain {}` method in `androidx.compose.runtime`). | Cmn |\n| [FrequentlyChangingValue](/reference/kotlin/androidx/compose/runtime/annotation/FrequentlyChangingValue) | FrequentlyChangingValue is used to denote properties and functions that return values that change frequently during runtime, and cause recompositions when they are read (for example, if they are backed with snapshot state). | Cmn |\n| [RememberInComposition](/reference/kotlin/androidx/compose/runtime/annotation/RememberInComposition) | RememberInComposition is used by an associated lint check to enforce that a marked constructor, function, or property getter is not called directly within composition. | Cmn |"]]