Supporting pane layout

A primary pane with a secondary pane of related content next to it.

When to use

Use SupportingPaneScaffold when a screen has a main task and supporting information, such as a document with comments. On large windows both panes show side by side. On small windows the supporting pane moves below the main content or into a sheet.

Examples

Main with related content

Resize the window.

val navigator = rememberSupportingPaneScaffoldNavigator<Nothing>()

Box(Modifier.fillMaxWidth().height(340.dp)) {
    SupportingPaneScaffold(
        directive = navigator.scaffoldDirective,
        scaffoldState = navigator.scaffoldState,
        mainPane = {
            AnimatedPane {
                Box(Modifier.fillMaxSize().padding(24.dp), contentAlignment = Alignment.Center) {
                    Text("Main content", style = MaterialTheme.typography.headlineMedium)
                }
            }
        },
        supportingPane = {
            AnimatedPane {
                Box(Modifier.fillMaxSize()) {
                    androidx.compose.foundation.layout.Column {
                        listOf("Related article", "Comments", "Sources").forEach { label ->
                            ListItem(headlineContent = { Text(label) })
                        }
                    }
                }
            }
        },
    )
}

Parameters

NameTypeDefaultDescription
mainPane@Composable ThreePaneScaffoldPaneScope.() -> UnitThe primary content.
supportingPane@Composable ThreePaneScaffoldPaneScope.() -> UnitRelated content.
extraPane@Composable (...)?nullOptional third pane.

Guidelines

Do:

Don't:

Accessibility

Related components