# OptIn

Artifact: [androidx.annotation:annotation-experimental](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/OptIn.kt+class:androidx.annotation.OptIn) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.1.0)

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE, AnnotationTarget.TYPEALIAS])
  @Target(value = [ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.PACKAGE, ElementType.TYPE, ElementType.PARAMETER])
  annotation OptIn
  ```

*** ** * ** ***

Allows use of an opt-in API denoted by the given markers in the annotated file, declaration, or expression. If a declaration is annotated with `https://developer.android.com/reference/kotlin/androidx/annotation/OptIn`, its usages are **not** required to opt-in to that API.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/OptIn#OptIn(kotlin.Array)(vararg markerClass: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html>)` | android |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-annotation/index.html>>` | `https://developer.android.com/reference/kotlin/androidx/annotation/OptIn#markerClass()` Defines the opt-in API(s) whose usage this annotation allows. | android |

## Public constructors

### OptIn

android Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.6.0)

```
OptIn(vararg markerClass: KClass<Annotation>)
```

## Public properties

### markerClass

android

```
val markerClass: Array<KClass<Annotation>>
```

Defines the opt-in API(s) whose usage this annotation allows.