---
title: "layoutItemInfoOf"
description: "Returns the TransformingLazyColumnFirstLayoutItemProvider.ItemInfo for the visible item with the given itemKey, aligned to the specified itemEdge."
type: "function"
lastmod: "2026-07-02T02:32:46.560421Z"
---
## API Reference

### layoutItemInfoOf

> Source set: Android

```kotlin
public fun TransformingLazyColumnState.layoutItemInfoOf(
    itemKey: Any,
    itemEdge: TransformingLazyColumnFirstLayoutItemProvider.ItemEdge,
): TransformingLazyColumnFirstLayoutItemProvider.ItemInfo?
```

Returns the [TransformingLazyColumnFirstLayoutItemProvider.ItemInfo](/jetpack-compose/androidx.wear.compose/compose-foundation/classes/TransformingLazyColumnFirstLayoutItemProvider.ItemInfo) for the visible item with
the given `itemKey`, aligned to the specified `itemEdge`. Returns null if the item is not
currently visible on screen.

This helper is useful when building a custom [TransformingLazyColumnFirstLayoutItemProvider](/jetpack-compose/androidx.wear.compose/compose-foundation/interfaces/TransformingLazyColumnFirstLayoutItemProvider) that
needs to track and stabilize the position of a specific key (e.g. an expanding item) during
content size animations.

#### Parameters

| | |
| --- | --- |
| itemKey | The unique key of the item to search for. |
| itemEdge | The [TransformingLazyColumnFirstLayoutItemProvider.ItemEdge](/jetpack-compose/androidx.wear.compose/compose-foundation/classes/TransformingLazyColumnFirstLayoutItemProvider.ItemEdge) (Start or End) of the item to use for the layout reference. |

## Code Examples
### TransformingLazyColumnFirstLayoutItemProviderSample
```kotlin
@Preview
@Composable
fun TransformingLazyColumnFirstLayoutItemProviderSample() {
    val state = rememberTransformingLazyColumnState()
    val transformationSpec = rememberTransformationSpec()
    // This sample demonstrates how to use rememberTransformingLazyColumnFirstLayoutItemProvider
    // to control the expansion direction of a dynamically resizing item. By using the voice input
    // card's Bottom/End edge as the layout reference, the card predictably expands upwards.
    // The constant key safely falls back to default layout behavior when scrolled off-screen.
    val firstLayoutItemProvider = rememberTransformingLazyColumnFirstLayoutItemProvider {
        state.layoutItemInfoOf(
            itemKey = "voice_input",
            itemEdge = TransformingLazyColumnFirstLayoutItemProvider.ItemEdge.End,
        )
    }
    var isListening by remember { mutableStateOf(false) }
    var lineCount by remember { mutableIntStateOf(0) }
    // Simple loop simulating text lines arriving over time
    LaunchedEffect(isListening) {
        if (isListening) {
            while (lineCount < 5) {
                delay(300)
                lineCount++
            }
            isListening = false
        }
    }
    AppScaffold {
        ScreenScaffold(state) { contentPadding ->
            TransformingLazyColumn(
                state = state,
                contentPadding = contentPadding,
                firstLayoutItemProvider = firstLayoutItemProvider,
            ) {
                items(count = 3, key = { "message_$it" }) { index ->
                    Card(
                        onClick = {},
                        modifier =
                            Modifier.minimumVerticalContentPadding(
                                    CardDefaults.minimumVerticalListContentPadding
                                )
                                .transformedHeight(this, transformationSpec)
                                .animateItem(placementSpec = null),
                        transformation = SurfaceTransformation(transformationSpec),
                    ) {
                        Text("Previous message $index")
                    }
                }
                item(key = "voice_input") {
                    val voiceText = (1..lineCount).joinToString("\n") { "Voice Input line $it" }
                    OutlinedCard(
                        onClick = {
                            if (lineCount >= 5) lineCount = 0
                            isListening = !isListening
                        },
                        modifier =
                            Modifier.minimumVerticalContentPadding(
                                    CardDefaults.minimumVerticalListContentPadding
                                )
                                .transformedHeight(this, transformationSpec)
                                .animateItem(placementSpec = null),
                        transformation = SurfaceTransformation(transformationSpec),
                    ) {
                        Text(text = voiceText.ifEmpty { "Tap to speak" })
                    }
                }
            }
        }
    }
}
```
