State of Compose 2023 results are in! Click here to learn more

← Back to Compose UI

LookaheadScope

Component
in
Compose UI
. Since 1.5.0-beta03

Overview

Code Examples

LookaheadScope starts a scope in which all layouts scope will receive a lookahead pass preceding the main measure/layout pass. This lookahead pass will calculate the layout size and position for all child layouts, and make the lookahead results available in Modifier.intermediateLayout. Modifier.intermediateLayout gets invoked in the main pass to allow transient layout changes in the main pass that gradually morph the layout over the course of multiple frames until it catches up with lookahead.

Overloads

LookaheadScope

@UiComposable
@Composable
fun LookaheadScope(content: @Composable @UiComposable LookaheadScope.() -> Unit)

Parameters

NameDescription
contentThe child composable to be laid out