parallax Layout
Creates a parallax effect on a composable as the user scrolls. The composable's vertical position is adjusted based on the scrollState.
This modifier is useful for creating depth in a scrollable layout, where some elements (like a background image) move at a different speed than the foreground content.
Return
A Modifier that applies the parallax layout behavior.
Parameters
The ScrollState of the scrollable container. The parallax effect is driven by changes in this state's value.
A factor to control the speed of the parallax effect. A higher rate results in a slower movement of the composable. A rate of 0 will cause the composable to move at the same speed as the scroll, while a negative rate is not recommended. The vertical offset is calculated as scrollState.value / rate.