# bringIntoViewResponder

Common/All

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.[bringIntoViewResponder](https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/bringIntoViewResponder.modifier#(androidx.compose.ui.Modifier).bringIntoViewResponder(androidx.compose.foundation.relocation.BringIntoViewResponder))(responder: https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/BringIntoViewResponder)` **This function is deprecated.** Use BringIntoViewModifierNode instead | Cmn |

## Functions

### Modifier.bringIntoViewResponder

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/relocation/BringIntoViewResponder.kt+function:bringIntoViewResponder) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.8.0)

```
fun Modifier.[bringIntoViewResponder](https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/bringIntoViewResponder.modifier#(androidx.compose.ui.Modifier).bringIntoViewResponder(androidx.compose.foundation.relocation.BringIntoViewResponder))(responder: BringIntoViewResponder): Modifier
```

> [!CAUTION]
> **This function is deprecated.**   
> Use BringIntoViewModifierNode instead

A parent that can respond to `https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/BringIntoViewRequester` requests from its children, and adjust itself so that the item is visible on screen. See `https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/BringIntoViewResponder` for more details about how this mechanism works.

```kotlin
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.relocation.BringIntoViewRequester
import androidx.compose.foundation.relocation.bringIntoViewRequester
import androidx.compose.foundation.rememberScrollState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.focusTarget
import androidx.compose.ui.focus.onFocusChanged

Row(Modifier.horizontalScroll(rememberScrollState())) {
    repeat(100) {
        val bringIntoViewRequester = remember { BringIntoViewRequester() }
        val coroutineScope = rememberCoroutineScope()
        Box(
            Modifier
                // This associates the RelocationRequester with a Composable that wants to be
                // brought into view.
                .bringIntoViewRequester(bringIntoViewRequester)
                .onFocusChanged {
                    if (it.isFocused) {
                        coroutineScope.launch {
                            // This sends a request to all parents that asks them to scroll so
                            // that this item is brought into view.
                            bringIntoViewRequester.bringIntoView()
                        }
                    }
                }
                .focusTarget()
        )
    }
}
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/relocation/BringIntoViewRequester` |   |