androidx.compose.material3.adaptive.layout
SupportingPaneScaffoldExperimental
Composable function · from org.jetbrains.compose.material3.adaptive:adaptive-layout:1.3.0
A supporting pane layout shows your main content, and a smaller pane with related content next to it. Think of a recipe with "similar recipes", or a document with comments.
- On a wide window, both show side by side.
- On a phone, only the main pane shows. Open the supporting pane with
navigator.navigateTo(SupportingPaneScaffoldRole.Supporting).

// In an app, call it without arguments: it reads the window size itself.
val navigator = rememberSupportingPaneScaffoldNavigator(
scaffoldDirective = calculatePaneScaffoldDirective(
WindowAdaptiveInfo(WindowSizeClass.BREAKPOINTS_V2.computeWindowSizeClass(widthDp = 840, heightDp = 480), Posture()),
),
)
Box(Modifier.size(840.dp, 260.dp)) {
SupportingPaneScaffold(
directive = navigator.scaffoldDirective,
scaffoldState = navigator.scaffoldState,
mainPane = {
AnimatedPane {
Column(Modifier.fillMaxSize().padding(16.dp)) {
Text("Pasta with tomatoes", style = MaterialTheme.typography.headlineSmall)
Text("Boil the pasta. Fry garlic in olive oil, add the tomatoes and cook for 10 minutes.")
}
}
},
supportingPane = {
AnimatedPane {
Column(Modifier.fillMaxSize().background(MaterialTheme.colorScheme.surfaceContainerLow).padding(16.dp)) {
Text("Similar recipes", style = MaterialTheme.typography.titleMedium)
Text("Pesto pasta")
Text("Tomato soup")
}
}
},
)
}
It works like the list-detail layout: create a navigator with rememberSupportingPaneScaffoldNavigator, pass its scaffoldDirective and scaffoldState, and wrap each pane in AnimatedPane.
Use a list-detail layout when the user picks one item from many. Use a supporting pane when the main content is always there and the side pane adds to it.
With a valueExperimental
You say which panes show. For full control or tests.
@Composable
fun SupportingPaneScaffold(
directive: PaneScaffoldDirective,
value: ThreePaneScaffoldValue,
mainPane: @Composable ThreePaneScaffoldPaneScope.() -> Unit,
supportingPane: @Composable ThreePaneScaffoldPaneScope.() -> Unit,
modifier: Modifier = Modifier,
extraPane: (@Composable ThreePaneScaffoldPaneScope.() -> Unit)? = null,
paneExpansionDragHandle: (@Composable ThreePaneScaffoldScope.(PaneExpansionState) -> Unit)? = null,
paneExpansionState: PaneExpansionState? = null,
)
directive: PaneScaffoldDirectiveRequired
directive: PaneScaffoldDirectiveRequiredHow many panes fit and how much space goes between them. Pass navigator.scaffoldDirective.
value: ThreePaneScaffoldValueRequired
value: ThreePaneScaffoldValueRequiredWhich panes show and which are hidden, as a fixed value. Usually you pass scaffoldState instead.
mainPane: @Composable ThreePaneScaffoldPaneScope.() -> UnitRequired
mainPane: @Composable ThreePaneScaffoldPaneScope.() -> UnitRequiredThe main content. Wrap it in AnimatedPane { }.
supportingPane: @Composable ThreePaneScaffoldPaneScope.() -> UnitRequired
supportingPane: @Composable ThreePaneScaffoldPaneScope.() -> UnitRequiredThe related content. Wrap it in AnimatedPane { }.
modifier: ModifierOptional
modifier: ModifierOptionalDefault: Modifier
Changes size, padding, or position. See the Modifier guide.
extraPane: (@Composable ThreePaneScaffoldPaneScope.() -> Unit)?Optional
extraPane: (@Composable ThreePaneScaffoldPaneScope.() -> Unit)?OptionalDefault: null
An optional third pane. It shows on very wide windows, and replaces the supporting pane on smaller ones.
paneExpansionDragHandle: (@Composable ThreePaneScaffoldScope.(PaneExpansionState) -> Unit)?OptionalSince 1.1
paneExpansionDragHandle: (@Composable ThreePaneScaffoldScope.(PaneExpansionState) -> Unit)?OptionalSince 1.1Default: null
A handle between the panes that the user drags to change their widths.
paneExpansionState: PaneExpansionState?OptionalSince 1.1
paneExpansionState: PaneExpansionState?OptionalSince 1.1Default: null
Remembers where the user dragged the handle. Create it with rememberPaneExpansionState.
With a stateExperimental
Animates between layouts. Use this with a navigator.
@Composable
fun SupportingPaneScaffold(
directive: PaneScaffoldDirective,
scaffoldState: ThreePaneScaffoldState,
mainPane: @Composable ThreePaneScaffoldPaneScope.() -> Unit,
supportingPane: @Composable ThreePaneScaffoldPaneScope.() -> Unit,
modifier: Modifier = Modifier,
extraPane: (@Composable ThreePaneScaffoldPaneScope.() -> Unit)? = null,
paneExpansionDragHandle: (@Composable ThreePaneScaffoldScope.(PaneExpansionState) -> Unit)? = null,
paneExpansionState: PaneExpansionState? = null,
)
scaffoldState: ThreePaneScaffoldStateRequiredSince 1.1
scaffoldState: ThreePaneScaffoldStateRequiredSince 1.1Which panes show, with animations between changes. Pass navigator.scaffoldState.
Same as above: directive, mainPane, supportingPane, modifier, extraPane, paneExpansionDragHandle, paneExpansionState.
See also
SupportingPaneScaffoldDefaults: default values and helper functions forSupportingPaneScaffold.