Bottom navigation bars allow movement between primary destinations in an app.
BottomNavigationSample
@Composable
fun BottomNavigationSample() {
var selectedItem by remember { mutableStateOf(0) }
val items = listOf("Songs", "Artists", "Playlists")
BottomNavigation(windowInsets = BottomNavigationDefaults.windowInsets) {
items.forEachIndexed { index, item ->
BottomNavigationItem(
icon = { Icon(Icons.Filled.Favorite, contentDescription = null) },
label = { Text(item) },
selected = selectedItem == index,
onClick = { selectedItem = index },
)
}
}
}