NavigationChromeState

Everything a navigation header needs, derived from the current navigation state.

Obtained from rememberNavigationChrome. Reaktiv supplies the values and the back action, the caller supplies the bar, so the same facts can drive a Material app bar, an iOS styled one, or anything else.

val chrome = rememberNavigationChrome()
TopAppBar(
title = { Text(chrome.title.orEmpty()) },
navigationIcon = {
chrome.onBack?.let { back -> IconButton(back) { Icon(ArrowBack, null) } }
}
)

See also

Properties

Link copied to clipboard

Resolved title of the destination a back navigation would reveal, or null at the root.

Link copied to clipboard

Whether a back navigation is possible from here.

Link copied to clipboard
val onBack: () -> Unit?

Performs a back navigation, or null when there is nowhere to go.

Link copied to clipboard

Route of the destination the header describes.

Link copied to clipboard

Resolved title of the current destination, or null when it declares none.