Object

TabRowDefaults

Contains default implementations and values used for TabRow.

Source set: Common
object TabRowDefaults

Contains default implementations and values used for TabRow.

Properties

ScrollableTabRowMinTabWidth

Source set: Common
val ScrollableTabRowMinTabWidth = 90.dp

The default minimum width for a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.

ScrollableTabRowEdgeStartPadding

Source set: Common
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

Source set: Common
val containerColor: Color

Default container color of a tab row.

primaryContainerColor

Source set: Common
val primaryContainerColor: Color

Default container color of a PrimaryTabRow.

secondaryContainerColor

Source set: Common
val secondaryContainerColor: Color

Default container color of a SecondaryTabRow.

contentColor

Deprecated

Use TabRowDefaults.primaryContentColor instead

Source set: Common
val contentColor: Color

Default content color of a tab row.

primaryContentColor

Source set: Common
val primaryContentColor: Color

Default content color of a PrimaryTabRow.

secondaryContentColor

Source set: Common
val secondaryContentColor: Color

Default content color of a SecondaryTabRow.

Functions

Indicator

@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

@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

@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

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.

Last updated: