AnimatedPage

Functions summary

Unit
@Composable
AnimatedPage(
    pageIndex: Int,
    pagerState: PagerState,
    contentScrimColor: Color,
    content: @Composable () -> Unit
)

Animates a page within a androidx.compose.foundation.pager.Pager with a scaling and scrim effect based on its position.

Functions

@Composable
fun AnimatedPage(
    pageIndex: Int,
    pagerState: PagerState,
    contentScrimColor: Color = MaterialTheme.colorScheme.background,
    content: @Composable () -> Unit
): Unit

Animates a page within a androidx.compose.foundation.pager.Pager with a scaling and scrim effect based on its position.

This composable applies a scaling animation and a scrim overlay to the page content, creating a visual cue for page transitions. The animation is responsive to the page's position within the androidx.compose.foundation.pager.Pager and adapts to the device's reduce motion settings and layout direction.

Parameters
pageIndex: Int

The index of the page being animated.

pagerState: PagerState

The PagerState of the androidx.compose.foundation.pager.Pager.

contentScrimColor: Color = MaterialTheme.colorScheme.background

The color of the scrim overlay applied during page transitions. Defaults to the background color of the MaterialTheme. Set this to transparent to have no scrim applied during page transitions.

content: @Composable () -> Unit

The composable content of the page.