public object TabRowDefaults
Contains default implementations and values used for TabRow.
Properties
ScrollableTabRowMinTabWidth
public val ScrollableTabRowMinTabWidth: Dp = 90.dp
The default minimum width for a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.
ScrollableTabRowEdgeStartPadding
public val ScrollableTabRowEdgeStartPadding: Dp = 52.dp
The default padding from the starting edge before a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.
containerColor
@Deprecated(
message = "Use TabRowDefaults.primaryContainerColor instead",
replaceWith = ReplaceWith("primaryContainerColor"),
)
public val containerColor: Color
Default container color of a tab row.
primaryContainerColor
public val primaryContainerColor: Color
Default container color of a PrimaryTabRow.
secondaryContainerColor
public val secondaryContainerColor: Color
Default container color of a SecondaryTabRow.
contentColor
@Deprecated(
message = "Use TabRowDefaults.primaryContentColor instead",
replaceWith = ReplaceWith("primaryContentColor"),
)
public val contentColor: Color
Default content color of a tab row.
primaryContentColor
public val primaryContentColor: Color
Default content color of a PrimaryTabRow.
secondaryContentColor
public val secondaryContentColor: Color
Default content color of a SecondaryTabRow.
Functions
Indicator
@Composable
@Deprecated(
message = "Use SecondaryIndicator instead.",
replaceWith = ReplaceWith("SecondaryIndicator(modifier, height, color)"),
)
public 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
@Composable
public 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
@Composable
public 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
@Deprecated(
level = DeprecationLevel.WARNING,
message =
"Solely for use alongside deprecated TabRowDefaults.Indicator method. For " +
"recommended PrimaryIndicator and SecondaryIndicator methods, please use " +
"TabIndicatorScope.tabIndicatorOffset method.",
)
public 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. |