Package-level declarations

Types

Link copied to clipboard
sealed class HeaderHeight

How the expanded header height is determined.

Link copied to clipboard
class LazyColumnConfig(val contentPadding: PaddingValues = PaddingValues(0.dp), val verticalArrangement: Arrangement.Vertical = Arrangement.Top, val horizontalAlignment: Alignment.Horizontal = Alignment.Start, val flingBehavior: FlingBehavior? = null, val userScrollEnabled: Boolean = true, val overscrollEffect: OverscrollEffect? = null)

Options forwarded to the LazyColumn used by ParallaxContent.Lazy.

Link copied to clipboard

Receiver of the actions slot: a RowScope that also exposes the toolbar scope.

Link copied to clipboard
class ParallaxBodyConfig(val minBottomSpacerHeight: Dp, val backgroundColor: Color = Color.Unspecified)

Body spacing and background.

Link copied to clipboard
sealed class ParallaxContent

The scrollable body of a ComposeParallaxToolbarLayout. The lambda receives true once the toolbar is collapsed.

Link copied to clipboard
class ParallaxHeaderConfig(val height: HeaderHeight, val gradient: Brush?, val isExpandedWhenFirstDisplayed: Boolean = true, val parallaxMultiplier: Float = ParallaxToolbarDefaults.HeaderParallaxMultiplier, val snapOnRelease: Boolean = false, val scrollMode: ScrollMode = ScrollMode.ExitUntilCollapsed, val fadeOnCollapse: Boolean = true, val stretchEnabled: Boolean = false, val stretchTriggerDistance: Dp = ParallaxToolbarDefaults.StretchTriggerDistance, val animationSpec: AnimationSpec<Float> = ParallaxToolbarDefaults.AnimationSpec, val snapThreshold: Float = ParallaxToolbarDefaults.SnapThreshold)

Header appearance and initial state.

Link copied to clipboard
class ParallaxSemanticsConfig(val expandedStateDescription: String = "Expanded", val collapsedStateDescription: String = "Collapsed", val expandActionLabel: String = "Expand header", val collapseActionLabel: String = "Collapse header")

Strings the layout exposes to accessibility services. Provide translated values.

Link copied to clipboard
class ParallaxTitleConfig(val paddingBottom: Dp, val paddingStart: Dp, val collapsedPaddingStart: Dp, val keepSubtitleAfterCollapse: Boolean, val animateSubTitleHiding: Boolean, val collapsedScale: Float = ParallaxToolbarDefaults.TitleCollapsedScale, val collapsedAlignment: Alignment.Horizontal = Alignment.Start)

Title and subtitle placement and collapse behavior.

Link copied to clipboard
class ParallaxToolbarConfig(val initialColor: Color, val targetColor: Color, val elevation: Dp, val animationSpec: AnimationSpec<Color>, val height: Dp = ParallaxToolbarDefaults.ToolbarHeight, val alwaysElevated: Boolean = false)

Toolbar colors, elevation and height.

Link copied to clipboard

Default values and factory methods for ComposeParallaxToolbarLayout.

Link copied to clipboard

Measured geometry of a ComposeParallaxToolbarLayout, in pixels, updated on every layout pass. All values are 0 until the layout has been measured once; check isMeasured.

Link copied to clipboard

Receiver of every content slot of ComposeParallaxToolbarLayout. Slots still receive the collapsed flag as their parameter; this scope adds the continuous collapseFraction for effects that should follow the scroll, and modifiers that give individual elements their own collapse behavior.

Link copied to clipboard

Hoisted state of a ComposeParallaxToolbarLayout: observe how far the toolbar has collapsed and drive it programmatically.

Link copied to clipboard

How the header and toolbar react to the body scrolling.

Functions

Link copied to clipboard
fun ComposeParallaxToolbarLayout(titleContent: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit, headerContent: @Composable ParallaxToolbarScope.() -> Unit, content: ParallaxContent, modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), subtitleContent: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit? = null, navigationIcon: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit? = null, actions: @Composable ParallaxActionsScope.(collapsed: Boolean) -> Unit? = null, overlayContent: @Composable ParallaxToolbarScope.() -> Unit? = null, bottomContent: @Composable ParallaxToolbarScope.() -> Unit? = null, onStretchTrigger: () -> Unit? = null, headerConfig: ParallaxHeaderConfig = ParallaxToolbarDefaults.headerConfig(), toolbarConfig: ParallaxToolbarConfig = ParallaxToolbarDefaults.toolbarConfig(), titleConfig: ParallaxTitleConfig = ParallaxToolbarDefaults.titleConfig(), bodyConfig: ParallaxBodyConfig = ParallaxToolbarDefaults.bodyConfig(), semanticsConfig: ParallaxSemanticsConfig = ParallaxToolbarDefaults.semanticsConfig(), windowInsets: WindowInsets = ParallaxToolbarDefaults.windowInsets, collapseEnabled: Boolean = true, state: ParallaxToolbarState = rememberParallaxToolbarState())

A collapsing toolbar with a parallax header for Compose Multiplatform.

fun ComposeParallaxToolbarLayout(titleContent: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit, headerContent: @Composable ParallaxToolbarScope.() -> Unit, content: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit, modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), subtitleContent: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit? = null, navigationIcon: @Composable ParallaxToolbarScope.(collapsed: Boolean) -> Unit? = null, actions: @Composable ParallaxActionsScope.(collapsed: Boolean) -> Unit? = null, overlayContent: @Composable ParallaxToolbarScope.() -> Unit? = null, bottomContent: @Composable ParallaxToolbarScope.() -> Unit? = null, onStretchTrigger: () -> Unit? = null, headerConfig: ParallaxHeaderConfig = ParallaxToolbarDefaults.headerConfig(), toolbarConfig: ParallaxToolbarConfig = ParallaxToolbarDefaults.toolbarConfig(), titleConfig: ParallaxTitleConfig = ParallaxToolbarDefaults.titleConfig(), bodyConfig: ParallaxBodyConfig = ParallaxToolbarDefaults.bodyConfig(), scroll: ScrollState = rememberScrollState(), lazyContent: LazyListScope.(Boolean) -> Unit? = null, lazyListState: LazyListState = rememberLazyListState(), lazyColumnConfig: LazyColumnConfig = LazyColumnConfig())

The 1.x entry point, kept so existing call sites compile. It wraps content or lazyContent into a ParallaxContent and scroll into a ParallaxToolbarState, then delegates to the main overload. It will be removed in 3.0.

Link copied to clipboard
fun rememberParallaxToolbarState(scrollState: ScrollState = rememberScrollState(), lazyListState: LazyListState = rememberLazyListState(), initiallyCollapsed: Boolean = false): ParallaxToolbarState

Creates and remembers a ParallaxToolbarState. Pass your own scrollState or lazyListState to share scroll position with other components; otherwise fresh ones are remembered.