← Back to Tv Material
TabRow
Component
in
Tv Material
. Since 1.0.0-alpha07Overview
Examples
Community Notes
Video
TV-Material Design Horizontal TabRow
Display all tabs in a set simultaneously and if the tabs exceed the container size, it has scrolling to navigate to next tab. They are best for switching between related content quickly, such as between transportation methods in a map. To navigate between tabs, use d-pad left or d-pad right when focused.
A TvTabRow contains a row of s, and displays an indicator underneath the currently selected tab. A TvTabRow places its tabs offset from the starting edge, and allows scrolling to tabs that are placed off screen.
Examples:
Overloads
TabRow
@Composable
fun TabRow(
selectedTabIndex: Int,
modifier: Modifier = Modifier,
containerColor: Color = TabRowDefaults.ContainerColor,
contentColor: Color = TabRowDefaults.contentColor(),
separator: @Composable () -> Unit = { TabRowDefaults.TabSeparator() },
indicator: @Composable (tabPositions: List<DpRect>) -> Unit =
@Composable { tabPositions ->
tabPositions.getOrNull(selectedTabIndex)?.let {
TabRowDefaults.PillIndicator(currentTabPosition = it)
}
},
tabs: @Composable () -> Unit
)
Parameters
Name | Description |
---|---|
selectedTabIndex | the index of the currently selected tab |
modifier | the Modifier to be applied to this tab row |
containerColor | the color used for the background of this tab row |
contentColor | the primary color used in the tabs |
separator | use this composable to add a separator between the tabs |
indicator | used to indicate which tab is currently selected and/or focused |
tabs | a composable which will render all the tab |
Previous Component← Tab
Next ComponentText →