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
- Kotlin
- Dart
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,
)
| Name | Type | Default |
|---|---|---|
title | String | required |
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 |
Design notes
Why CamoTopBar works this way, its states and its edge cases: contributor docs.