---
title: "ReadOnlyComposable"
description: "This annotation can be applied to [Composable] functions so that no group will be generated
around the body of the function it annotates. This is not safe unless the body of the function
and any functions that it calls only executes \"read\" operations on the passed in composer. This
will result in slightly more efficient code.

A common use case for this are for functions that only need to be composable in order to read
[CompositionLocal] values, but don't call any other composables.

Caution: Use of this annotation means that the annotated declaration *MUST* comply with this
contract, or else the resulting code's behavior will be undefined."
type: "class"
---

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


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

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


```kotlin
@MustBeDocumented
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER)
public annotation class ReadOnlyComposable
```


This annotation can be applied to `Composable` functions so that no group will be generated
around the body of the function it annotates. This is not safe unless the body of the function
and any functions that it calls only executes "read" operations on the passed in composer. This
will result in slightly more efficient code.

A common use case for this are for functions that only need to be composable in order to read
`CompositionLocal` values, but don't call any other composables.

Caution: Use of this annotation means that the annotated declaration *MUST* comply with this
contract, or else the resulting code's behavior will be undefined.



