TabBar

fun <T> TabBar(items: List<TabBarItemData<T>>, selection: T, onSelectionChange: (T) -> Unit, modifier: Modifier = Modifier, containerColor: Color = MaterialTheme.colorScheme.surface, windowInsets: WindowInsets = TabBarDefaults.windowInsets, arrangement: TabBarArrangement = TabBarDefaults.arrangement, colors: TabBarItemColors = TabBarDefaults.itemColors(), scrollBehavior: TabBarScrollBehavior? = null)

A bottom navigation bar built from items. With a scrollBehavior it hides while the content scrolls down; attach the behavior's nestedScrollConnection to that content. For per-item control use the overload that takes TabBarItems.


fun TabBar(modifier: Modifier = Modifier, containerColor: Color = MaterialTheme.colorScheme.surface, windowInsets: WindowInsets = TabBarDefaults.windowInsets, arrangement: TabBarArrangement = TabBarDefaults.arrangement, scrollBehavior: TabBarScrollBehavior? = null, content: @Composable RowScope.() -> Unit)

A bottom navigation bar whose destinations are TabBarItems in content. The destinations form one selectable group. As a scrollBehavior hides the bar, the bar also reports a smaller height, so a Scaffold gives the space back to the content.