← Back to Tv Material
Tab
Overview
Code Examples
Video
Material Design tab.
A default Tab, also known as a Primary Navigation Tab. Tabs organize content across different screens, data sets, and other interactions.
This should typically be used inside of a TabRow, see the corresponding documentation for example usage.
@param selected whether this tab is selected or not @param onFocus called when this tab is focused @param modifier the Modifier to be applied to this tab @param onClick called when this tab is clicked (with D-Pad Center) @param 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. @param colors these will be used by the tab when in different states (focused, selected, etc.) @param interactionSource the MutableInteractionSource representing the stream of Interactions for this tab. You can create and pass in your own remember
ed instance to observe Interactions and customize the appearance / behavior of this tab in different states. @param content content of the Tab
Overloads
Tab
@Composable
fun Tab(
selected: Boolean,
onFocus: () -> Unit,
modifier: Modifier = Modifier,
onClick: () -> Unit = { },
enabled: Boolean = true,
colors: TabColors = TabDefaults.pillIndicatorTabColors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
content: @Composable RowScope.() -> Unit
)
Parameters
Name | Description |
---|---|
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 | the MutableInteractionSource representing the stream of Interactions for this tab. You can create and pass in your own remember ed instance to observe Interactions and customize the appearance / behavior of this tab in different states. |
content | content of the Tab |