<div class='type'>Composable Function</div>


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



<h2 id="rememberscrollstate-initial">rememberScrollState</h2>

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


```kotlin
@Composable
fun rememberScrollState(initial: Int = 0): ScrollState
```


Create and `remember` the `ScrollState` based on the currently appropriate scroll configuration
to allow changing scroll position or observing scroll behavior.

Learn how to control the state of `Modifier.verticalScroll` or `Modifier.horizontalScroll`:

#### Parameters

| | |
| --- | --- |
| initial | initial scroller position to start with |