# CompositionInstance

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/tooling/CompositionData.kt+class:androidx.compose.runtime.tooling.CompositionInstance) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.8.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface CompositionInstance
  ```

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance` provides information about the composition of which a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionData` is part.

## Summary

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionGroup?` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance#findContextGroup()()` Find the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionGroup` that contains the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext` created by a call to `https://developer.android.com/reference/kotlin/androidx/compose/runtime/rememberCompositionContext.composable#rememberCompositionContext()` that is the parent context for this composition. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionData` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance#data()` The `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionData` for the instance | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance?` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance#parent()` The parent composition instance, if the instance is part of a sub-composition. | Cmn |

## Public functions

### findContextGroup

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.8.0)

```
fun findContextGroup(): CompositionGroup?
```

Find the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionGroup` that contains the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext` created by a call to `https://developer.android.com/reference/kotlin/androidx/compose/runtime/rememberCompositionContext.composable#rememberCompositionContext()` that is the parent context for this composition. If this is the root of the composition (e.g. `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance#parent()` is `null`) then this method also returns `null`.

## Public properties

### data

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.8.0)

```
val data: CompositionData
```

The `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionData` for the instance

### parent

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.8.0)

```
val parent: CompositionInstance?
```

The parent composition instance, if the instance is part of a sub-composition. If this is the root of a composition (such as the content of a ComposeView), then `https://developer.android.com/reference/kotlin/androidx/compose/runtime/tooling/CompositionInstance#parent()` will be `null`.