Object

TabRowDefaults

Contains default implementations and values used for TabRow.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
object TabRowDefaults

Contains default implementations and values used for TabRow.

Properties

Common
val ScrollableTabRowMinTabWidth = 90.dp

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

Common
val ScrollableTabRowEdgeStartPadding = 52.dp

The default padding from the starting edge before a tab in a PrimaryScrollableTabRow or SecondaryScrollableTabRow.

Common
Deprecated Use TabRowDefaults.primaryContainerColor instead
val containerColor: Color

Default container color of a tab row.

Common
val primaryContainerColor: Color

Default container color of a PrimaryTabRow.

Common
val secondaryContainerColor: Color

Default container color of a SecondaryTabRow.

Common
Deprecated Use TabRowDefaults.primaryContentColor instead
val contentColor: Color

Default content color of a tab row.

Common
val primaryContentColor: Color

Default content color of a PrimaryTabRow.

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.