We just launched Compose Examples featuring over 150+ components! Check it out →

LeadingIconTab

Common

Component in Material Compose

Tabs organize content across different screens, data sets, and other interactions.

Tab image

Last updated:

Installation

dependencies {
   implementation("androidx.compose.material:material:1.8.0-alpha04")
}

Overloads

@Composable
fun LeadingIconTab(
    selected: Boolean,
    onClick: () -> Unit,
    text: @Composable (() -> Unit),
    icon: @Composable (() -> Unit),
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    interactionSource: MutableInteractionSource? = null,
    selectedContentColor: Color = LocalContentColor.current,
    unselectedContentColor: Color = selectedContentColor.copy(alpha = ContentAlpha.medium)
)

Parameters

namedescription
selectedwhether this tab is selected or not
onClickthe callback to be invoked when this tab is selected
textthe text label displayed in this tab
iconthe icon displayed in this tab
modifieroptional [Modifier] for this tab
enabledcontrols the enabled state of this tab. When false, this tab will not be clickable and will appear disabled to accessibility services.
interactionSourcean optional hoisted [MutableInteractionSource] for observing and emitting [Interaction]s for this tab. You can use this to change the tab's appearance or preview the tab in different states. Note that if null is provided, interactions will still happen internally.
selectedContentColorthe color for the content of this tab when selected, and the color of the ripple.
unselectedContentColorthe color for the content of this tab when not selected
by @alexstyl