# Stable

Artifact: [androidx.compose.runtime:runtime-annotation](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/Stable.kt+class:androidx.compose.runtime.Stable) Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.9.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @MustBeDocumented
  @Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY])
  @Retention(value = AnnotationRetention.BINARY)
  @StableMarker
  annotation Stable
  ```

*** ** * ** ***

Stable is used to communicate some guarantees to the compose compiler about how a certain type or function will behave.

When applied to a class or an interface, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Stable` indicates that the following must be true:

1. The result of `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/equals.html` will always return the same result for the same two instances.

2. When a public property of the type changes, composition will be notified.

3. All public property types are stable.

When applied to a function or a property, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Stable` annotation indicates that the function will return the same result if the same parameters are passed in. This is only meaningful if the parameters and results are themselves `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Stable`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutable`, or primitive.

The invariants that this annotation implies are used for optimizations by the compose compiler, and have undefined behavior if the above assumptions are not met. As a result, one should not use this annotation unless they are certain that these conditions are satisfied.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutable` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/StableMarker` |   |

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Stable#Stable()()` | Cmn |

## Public constructors

### Stable

Cmn

```
Stable()
```