---
title: "ComposableTarget"
description: "The [Composable] function is declared to expect an applier with the name [applier]. The [applier]
name can be an arbitrary string but is expected to be a fully qualified name of a class that is
annotated by [ComposableTargetMarker] containing a descriptive name to be used in diagnostic
messages.

The [applier] name is used in diagnostic messages but, if it refers to a marked annotation,
[ComposableTargetMarker.description] is used instead of the class name.

The Compose compiler plugin can, in most cases, infer this or an equivalent
[ComposableInferredTarget], for composable functions. For example, if a composable function calls
another composable function then both must be of the same group of composable functions (that is,
have declared or inferred the same [applier] value). This means that, if the function called is
already determined to be in a group, them the function that calls it must also be in the same
group. If two functions are called of different groups then the Compose compiler plugin will
generate an diagnostic message describing which group was received and which group was expected.

The grouping of composable functions corresponds to the instance of [Applier] that is required to
be used by the [Composer] to apply changes to the composition. The [Applier] is checked at
runtime to ensure the [Applier] that is expected by a composable function is the one supplied at
runtime. This annotation, and the corresponding validation performed by the Compose compiler
plugin, can detect mismatches at compile time, and issue a diagnostic message when calling a
[Composable] function will result in the [Applier] check failing.

In most cases this annotation can be inferred. However, this annotation is required for
[Composable] functions that call [ComposeNode] directly, for abstract methods, such as interfaces
functions (which do not contain a body from which the plugin can infer the annotation), when
using a composable lambda in sub-composition, or when a composable lambda is stored in a class
field or global variable.

Leaving the annotation off in such cases will result in the compiler ignoring the function and it
will not emit the diagnostic when the function is called incorrectly."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@Target(
    AnnotationTarget.FILE,
    AnnotationTarget.CLASS,
    AnnotationTarget.FUNCTION,
    AnnotationTarget.PROPERTY_GETTER,
    AnnotationTarget.TYPE,
    AnnotationTarget.TYPE_PARAMETER,
)
public annotation class ComposableTarget(val applier: String)
```


The `Composable` function is declared to expect an applier with the name `applier`. The `applier`
name can be an arbitrary string but is expected to be a fully qualified name of a class that is
annotated by `ComposableTargetMarker` containing a descriptive name to be used in diagnostic
messages.

The `applier` name is used in diagnostic messages but, if it refers to a marked annotation,
`ComposableTargetMarker.description` is used instead of the class name.

The Compose compiler plugin can, in most cases, infer this or an equivalent
`ComposableInferredTarget`, for composable functions. For example, if a composable function calls
another composable function then both must be of the same group of composable functions (that is,
have declared or inferred the same `applier` value). This means that, if the function called is
already determined to be in a group, them the function that calls it must also be in the same
group. If two functions are called of different groups then the Compose compiler plugin will
generate an diagnostic message describing which group was received and which group was expected.

The grouping of composable functions corresponds to the instance of `Applier` that is required to
be used by the `Composer` to apply changes to the composition. The `Applier` is checked at
runtime to ensure the `Applier` that is expected by a composable function is the one supplied at
runtime. This annotation, and the corresponding validation performed by the Compose compiler
plugin, can detect mismatches at compile time, and issue a diagnostic message when calling a
`Composable` function will result in the `Applier` check failing.

In most cases this annotation can be inferred. However, this annotation is required for
`Composable` functions that call `ComposeNode` directly, for abstract methods, such as interfaces
functions (which do not contain a body from which the plugin can infer the annotation), when
using a composable lambda in sub-composition, or when a composable lambda is stored in a class
field or global variable.

Leaving the annotation off in such cases will result in the compiler ignoring the function and it
will not emit the diagnostic when the function is called incorrectly.

#### Parameters

| | |
| --- | --- |
| applier | The applier name used during composable call checking. This is usually inferred by the compiler. This can be an arbitrary string value but is expected to be a fully qualified name of a class that is marked with `ComposableTargetMarker`. |




