---
title: "setOnReadyForComposition"
description: "The callback to be executed when the View is attached to the window or a custom [ComposeViewContext] is used."
type: "function"
lastmod: "2026-08-27"
---
## API Reference

### setOnReadyForComposition

> Source set: Android

```kotlin
fun setOnReadyForComposition(callback: (ComposeViewContext) -> Unit)
```

The callback to be executed when the View is attached to the window or a custom
[ComposeViewContext](/jetpack-compose/androidx.compose.ui/ui/classes/ComposeViewContext/api) is used. Note that this callback will be fired inline if it is already
ready.
