Skip to main content

CamoTopBar

A screen's top bar: a title, a navigation button, and actions (icon buttons; extras go in a "More" menu). The skin decides where they sit. Pass scrollOffset from rememberTopBarScrollOffset so the bar separates from content scrolled under it. titleContent replaces the drawn title; title stays the bar's heading for screen readers. visible = false slides the bar up out of view (with rememberHideOnScroll).

API​

public fun CamoTopBar(
title: String,
modifier: Modifier = Modifier,
navigation: (@Composable () -> Unit)? = null,
actions: @Composable RowScope.() -> Unit = {},
scrollOffset: Dp = 0.dp,
titleContent: (@Composable () -> Unit)? = null,
visible: Boolean = true,
windowInsets: WindowInsets = TopBarDefaultInsets,
)
NameTypeDefault
titleStringrequired
modifierModifierModifier
navigation(@Composable () -> Unit)?null
actions@Composable RowScope.() -> Unit{}
scrollOffsetDp0.dp
titleContent(@Composable () -> Unit)?null
visibleBooleantrue
windowInsetsWindowInsetsTopBarDefaultInsets
Design notes

Why CamoTopBar works this way, its states and its edge cases: contributor docs.