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


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



<h2 id="rememberpagerstate-initialpage-pagecount">rememberPagerState</h2>

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


```kotlin
@Composable
fun rememberPagerState(
    initialPage: Int = 0,
    @FloatRange(from = -0.5, to = 0.5) initialPageOffsetFraction: Float = 0f,
    pageCount: () -> Int,
): PagerState
```


Creates and remember a `PagerState` to be used with a `Pager`

Please refer to the sample to learn how to use this API.

#### Parameters

| | |
| --- | --- |
| initialPage | The pager that should be shown first. |
| initialPageOffsetFraction | The offset of the initial page as a fraction of the page size. This should vary between -0.5 and 0.5 and indicates how to offset the initial page from the snapped position. |
| pageCount | The amount of pages this Pager will have. |