---
title: "verticalScroll"
description: "Modify element to allow it to scroll vertically when its content is larger than its constraints."
type: "function"
---
## API Reference

### verticalScroll

> Source set: Android

```kotlin
public fun RemoteModifier.verticalScroll(state: RemoteScrollState): RemoteModifier
```

Modify element to allow it to scroll vertically when its content is larger than its constraints.

#### Parameters

| | |
| --- | --- |
| state | The [RemoteScrollState](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteScrollState) that tracks and controls the scroll position. It can be created and remembered using [rememberRemoteScrollState](/jetpack-compose/androidx.compose.remote/remote-creation-compose/composable-functions/rememberRemoteScrollState). |

#### Return

The modified [RemoteModifier](/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemoteModifier).

## Code Examples

### VerticalScrollSample

```kotlin
@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun VerticalScrollSample() {
    val scrollState = rememberRemoteScrollState()
    RemoteColumn(
        modifier =
            RemoteModifier.size(200.rdp).background(Color.LightGray.rc).verticalScroll(scrollState)
    ) {
        for (i in 1..10) {
            RemoteBox(
                modifier =
                    RemoteModifier.size(180.rdp, 50.rdp).padding(5.rdp).background(Color.Red.rc),
                contentAlignment = RemoteAlignment.Center,
            ) {
                RemoteText("Item $i".rs, color = Color.White.rc)
            }
        }
    }
}
```
