🌈 Create new beautiful Compose Gradients with our new wesite ->

LeadingIconTab

Kotlin
@Composable
fun LeadingIconTabSample() {
    var selectedTab by remember { mutableIntStateOf(0) }
    val tabs = listOf("Home" to Icons.Filled.Home, "Favorites" to Icons.Filled.Favorite)

    PrimaryTabRow(selectedTabIndex = selectedTab) {
        tabs.forEachIndexed { index, (label, icon) ->
            LeadingIconTab(
                selected = selectedTab == index,
                onClick = { selectedTab = index },
                text = { Text(label) },
                icon = { Icon(icon, contentDescription = null) },
            )
        }
    }
}