PageScaffold

fun PageScaffold(title: String, modifier: Modifier = Modifier, style: TopBarStyle = TopBarStyle.Large, actions: @Composable RowScope.() -> Unit = {}, floatingActionButton: @Composable () -> Unit = {}, fabs: List<ToolkitFab> = emptyList(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, topBarScrollMode: TopBarScrollMode = LocalTopBarScrollMode.current, backButton: Boolean = true, content: @Composable () -> Unit)(source)

The frame of a page: an app bar with a back button, and a body under it.

topBarScrollMode comes from the destination by default. TopBarScrollMode.Static keeps the bar expanded and visible without scroll tint, even when the shell hides bars on scroll.

The back button closes the page, and any detail open beside it, through the shell navigator. A task the person finishes with a button of its own, such as a cleanup that ends in Done, passes backButton = false: the bar keeps its title and actions, and system back still reaches the screen, which handles it the way its own button does. Inside a list-detail pane the frame draws no app bar at all: the scene draws one bar across both panes, titled from each page. A large bar becomes a small one on a window too short for it.

The body is laid out edge to edge at the bottom: it reaches behind the system navigation bar, which it receives as LocalContentPadding instead, so its lists scroll under the bar rather than stopping at a band above it. The top and the sides are padded here.

Pages registered with a title get this frame from the shell; pages that need something under their app bar, such as tabs, call it themselves, and give it topBarContainerColor() so it changes colour with the bar as content scrolls under them.

Snackbars shown through rememberScaffoldSnackbars(), MessageHost or LocalPageSnackbarHostState appear above the system bars and the buttons, in the Toolkit's normal or error style or as the screen draws them.

Floating action buttons come from fabs, from what the screen inside declares with ScaffoldFabs, and from floatingActionButton for a button drawn by hand; the frame stacks the described ones in a column at the bottom end.

A screen inside can turn the app bar into an article bar with ScaffoldArticleTopBar; inside a list-detail pane it reaches the scene's bar over that pane instead.