Package-level declarations

Types

Link copied to clipboard

How far an app bar has slid away, for HideOnScrollTopBar. Attach nestedScrollConnection to the scaffold after the bar's own scroll behaviour, so a large bar collapses first and only then slides away; scrolling back up brings it back at once, as Material's enter-always bars do.

Link copied to clipboard
class TopBarSearch(val state: ShellSearch, val hint: String)

A search field for ShellTopAppBar's title slot.

Properties

Link copied to clipboard

The part of a screen the shell draws over: the system navigation bar, and on a tab the bottom navigation bar, the banner and the docked mini player.

Link copied to clipboard

Whether app bars slide away as content scrolls down, whatever their style. The shell provides it from its settings; PageScaffold and the shell's tab scaffold read it.

Link copied to clipboard

The snackbar host of the page frame a screen is drawn in, or null outside one.

Link copied to clipboard

A style that replaces every destination's own, set from the developer options to try one bar across the whole app. Null keeps each destination's.

Link copied to clipboard

How far the app bar above is tinted by the content scrolled under it, provided by PageScaffold and the shell's tabs. Null outside them, under a bar that does not react to scrolling, and where the bar is see-through over a tinted frame.

Functions

Link copied to clipboard

LocalContentPadding plus extra, for the content padding of a scrolling container.

Link copied to clipboard
fun ContentWidthBox(maxWidth: Dp, modifier: Modifier = Modifier, content: @Composable () -> Unit)

Centres content in a column no wider than maxWidth, leaving equal margins on both sides once the space is wider, the way a website lays out its page. Dp.Unspecified fills the space.

Link copied to clipboard

Uses a small bar while an article bar is declared. A large bar would show a second, expanded title above the article's own header.

Link copied to clipboard

How far the navigation's shared colour should follow this bar, the way Material tints the bar itself: a large bar blends as it collapses, the others switch once content scrolls under them. Read it inside FollowScrollWithFrameTint.

Link copied to clipboard

Lays out bar less the part of it that state has slid away, so the scaffold's content moves up with it. The bar leaves entirely, the part behind the status bar too, and the content scrolls on under the status bar, edge to edge. With enabled false the bar is laid out whole.

Link copied to clipboard

The placeholder for an app's own list pages.

Link copied to clipboard
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)

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

Link copied to clipboard
fun PanePlaceholder(icon: ImageVector, title: String?, message: String)

What the detail side of a list page shows before anything is chosen: an icon, a title, a hint.

Link copied to clipboard

Two paddings added side by side, resolved against the layout direction when used.

Link copied to clipboard

The page frame's snackbar host, or a new one remembered here for a screen outside a page.

Link copied to clipboard

Returns the scroll behaviour that suits style: large bars collapse until the content is back at the top, the others stay pinned and only change colour. A TopBarStyle.LargeCollapsed bar starts collapsed, once, and keeps whatever the person scrolls it to after that.

Link copied to clipboard
suspend fun TopAppBarScrollBehavior.resetTo(collapsed: Boolean)

Moves the bar back to where a newly opened destination starts: fully expanded, or fully collapsed once the bar has measured how far it can collapse.

Link copied to clipboard
fun ShellTopAppBar(style: TopBarStyle, title: String, navigationIcon: @Composable () -> Unit, actions: @Composable RowScope.() -> Unit, scrollBehavior: TopAppBarScrollBehavior?, windowInsets: WindowInsets = topBarInsets(), search: TopBarSearch? = null, colors: TopAppBarColors? = null, titleModifier: Modifier = Modifier, article: ArticleTopBarHost? = null)

Draws style. Draws nothing for TopBarStyle.Hidden.

Link copied to clipboard

The colour the app bar above is drawn in right now, for what sits flush under it, such as a tab row, so the bar and the tabs read as one surface and change colour together as content scrolls under them:

Link copied to clipboard
fun topBarInsets(reachesStart: Boolean = true): WindowInsets

The insets an app bar keeps clear of: the status bar and any display cutout, on the top and on the sides the bar reaches. A bar beside a rail or drawer only reaches the end side.

Link copied to clipboard

Splits a scaffold's padding into what the frame applies itself, its top and sides, and the bottom, which the content receives through LocalContentPadding so it can scroll behind it.