Added in 1.5.0-alpha17
object TabRowDefaults
Contains default implementations and values used for TabRow.
Properties
ScrollableTabRowMinTabWidth
Added in 1.5.0-alpha17
val ScrollableTabRowMinTabWidth = 90.dp
The default minimum width for a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.
ScrollableTabRowEdgeStartPadding
Added in 1.5.0-alpha17
val ScrollableTabRowEdgeStartPadding = 52.dp
The default padding from the starting edge before a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.
containerColor
Deprecated
Use TabRowDefaults.primaryContainerColor instead
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val containerColor: Color
Default container color of a tab row.
primaryContainerColor
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val primaryContainerColor: Color
Default container color of a PrimaryTabRow.
secondaryContainerColor
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val secondaryContainerColor: Color
Default container color of a SecondaryTabRow.
contentColor
Deprecated
Use TabRowDefaults.primaryContentColor instead
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val contentColor: Color
Default content color of a tab row.
primaryContentColor
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val primaryContentColor: Color
Default content color of a PrimaryTabRow.
secondaryContentColor
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
val secondaryContentColor: Color
Default content color of a SecondaryTabRow.
Functions
Indicator
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
@Composable
fun Indicator(
modifier: Modifier = Modifier,
height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight,
color: Color =
MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ActiveIndicatorColor),
)
Default indicator, which will be positioned at the bottom of the TabRow, on top of the divider.
Parameters
| modifier | modifier for the indicator's layout |
| height | height of the indicator |
| color | color of the indicator |
PrimaryIndicator
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
@Composable
fun PrimaryIndicator(
modifier: Modifier = Modifier,
width: Dp = 24.dp,
height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight,
color: Color = PrimaryNavigationTabTokens.ActiveIndicatorColor.value,
shape: Shape = PrimaryNavigationTabTokens.ActiveIndicatorShape,
)
Primary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.
Parameters
| modifier | modifier for the indicator's layout |
| width | width of the indicator |
| height | height of the indicator |
| color | color of the indicator |
| shape | shape of the indicator |
SecondaryIndicator
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
@Composable
fun SecondaryIndicator(
modifier: Modifier = Modifier,
height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight,
color: Color = PrimaryNavigationTabTokens.ActiveIndicatorColor.value,
)
Secondary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.
Parameters
| modifier | modifier for the indicator's layout |
| height | height of the indicator |
| color | color of the indicator |
tabIndicatorOffset
Added in 1.5.0-alpha17
Deprecated in 1.5.0-alpha17
fun Modifier.tabIndicatorOffset(currentTabPosition: TabPosition): Modifier
Modifier that takes up all the available width inside the TabRow, and then animates the offset of the indicator it is applied to, depending on the currentTabPosition.
Parameters
| currentTabPosition | TabPosition of the currently selected tab. This is used to calculate the offset of the indicator this modifier is applied to, as well as its width. |