# ComposableOpenTarget

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/ComposableOpenTarget.kt+class:androidx.compose.runtime.ComposableOpenTarget) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.2.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER])
  annotation ComposableOpenTarget
  ```

*** ** * ** ***

The `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable` declares that it doesn't expect a particular applier. See `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableTarget` for more details on what appliers a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable` function expects.

In a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable` function, all the open composable appliers with the same applier index must have the same name.. `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocalProvider.composable#CompositionLocalProvider(kotlin.Array,kotlin.Function0)`, for example, can use `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget` to declare that its content parameter must have the same applier as it receives, since it calls the content parameter directly, but it could be any applier. `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget`, in this way, works like an open type parameter for the type of applier used by the implied composer parameter.

Th `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget` is unlikely to be required explicitly as it is inferred automatically by the Compose compiler plugin. See `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableTarget` for more details on how attributes are inferred.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget#ComposableOpenTarget(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget#index()` The index of the open applier parameter. | Cmn |

## Public constructors

### ComposableOpenTarget

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

```
ComposableOpenTarget(index: Int)
```

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the open applier parameter. All open appliers with the same non-negative index in the same declaration must have the same name. All negative indexes are considered anonymous and can match any applier. If the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget#index()` is only used once in a declaration it can also match any applier but it is recommended to use a negative index instead or just leave the annotation off as a missing annotation is equivalent to an anonymous applier. |

## Public properties

### index

Cmn

```
val index: Int
```

The index of the open applier parameter. All open appliers with the same non-negative index in the same declaration must have the same name. All negative indexes are considered anonymous and can match any applier. If the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposableOpenTarget#index()` is only used once in a declaration it can also match any applier but it is recommended to use a negative index instead or just leave the annotation off as a missing annotation is equivalent to an anonymous applier.