androidx.compose.foundation.pager

rememberPagerState

Function · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

Creates and remember a PagerState to be used with a Pager

Parameters

@Composable
fun rememberPagerState(
    initialPage: Int = 0,
    initialPageOffsetFraction: Float = 0f,
    pageCount: () -> Int,
): PagerState

initialPage: IntOptional

Default: 0

The pager that should be shown first.

initialPageOffsetFraction: FloatOptional

Default: 0f

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: () -> IntRequired

The amount of pages this Pager will have.

Library docs

Creates and remember a PagerState to be used with a Pager

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