Tab
Composable Component
Material Design tab.
Android
@Composable
fun TabRowScope.Tab(
selected: Boolean,
onFocus: () -> Unit,
modifier: Modifier = Modifier,
onClick: () -> Unit = {},
enabled: Boolean = true,
colors: TabColors = TabDefaults.pillIndicatorTabColors(),
interactionSource: MutableInteractionSource? = null,
content: @Composable RowScope.() -> Unit
)
Parameters
selected | whether this tab is selected or not |
onFocus | called when this tab is focused |
modifier | the Modifier to be applied to this tab |
onClick | called when this tab is clicked (with D-Pad Center) |
enabled | controls the enabled state of this tab. When false , this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services. |
colors | these will be used by the tab when in different states (focused, selected, etc.) |
interactionSource | an 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. |
content | content of the Tab |
Create your own Component Library
Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled