TabRowDefaults


Contains default implementations and values used for TabRow.

Summary

Public functions

Unit
@Composable
Indicator(modifier: Modifier, height: Dp, color: Color)

This function is deprecated. Use SecondaryIndicator instead.

Cmn
Unit
@Composable
PrimaryIndicator(
    modifier: Modifier,
    width: Dp,
    height: Dp,
    color: Color,
    shape: Shape
)

Primary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Cmn
Unit
@Composable
SecondaryIndicator(modifier: Modifier, height: Dp, color: Color)

Secondary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Cmn
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.

Cmn

Public properties

Dp

The default padding from the starting edge before a tab in a ScrollableTabRow.

Cmn
Color

This property is deprecated. Use TabRowDefaults.primaryContainerColor instead

Cmn
Color

This property is deprecated. Use TabRowDefaults.primaryContentColor instead

Cmn
Color

Default container color of a PrimaryTabRow.

Cmn
Color

Default content color of a PrimaryTabRow.

Cmn
Color

Default container color of a SecondaryTabRow.

Cmn
Color

Default content color of a SecondaryTabRow.

Cmn

Public functions

Indicator

@Composable
fun Indicator(
    modifier: Modifier = Modifier,
    height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight,
    color: Color = MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ActiveIndicatorColor)
): Unit

Default indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
modifier: Modifier = Modifier

modifier for the indicator's layout

height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight

height of the indicator

color: Color = MaterialTheme.colorScheme.fromToken(PrimaryNavigationTabTokens.ActiveIndicatorColor)

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
): Unit

Primary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
modifier: Modifier = Modifier

modifier for the indicator's layout

width: Dp = 24.dp

width of the indicator

height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight

height of the indicator

color: Color = PrimaryNavigationTabTokens.ActiveIndicatorColor.value

color of the indicator

shape: Shape = PrimaryNavigationTabTokens.ActiveIndicatorShape

shape of the indicator

SecondaryIndicator

@Composable
fun SecondaryIndicator(
    modifier: Modifier = Modifier,
    height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight,
    color: Color = PrimaryNavigationTabTokens.ActiveIndicatorColor.value
): Unit

Secondary indicator, which will be positioned at the bottom of the TabRow, on top of the divider.

Parameters
modifier: Modifier = Modifier

modifier for the indicator's layout

height: Dp = PrimaryNavigationTabTokens.ActiveIndicatorHeight

height of the indicator

color: Color = PrimaryNavigationTabTokens.ActiveIndicatorColor.value

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

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.

Public properties

ScrollableTabRowEdgeStartPadding

val ScrollableTabRowEdgeStartPaddingDp

The default padding from the starting edge before a tab in a ScrollableTabRow.

containerColor

val containerColorColor

Default container color of a tab row.

contentColor

val contentColorColor

Default content color of a tab row.

primaryContainerColor

val primaryContainerColorColor

Default container color of a PrimaryTabRow.

primaryContentColor

val primaryContentColorColor

Default content color of a PrimaryTabRow.

secondaryContainerColor

val secondaryContainerColorColor

Default container color of a SecondaryTabRow.

secondaryContentColor

val secondaryContentColorColor

Default content color of a SecondaryTabRow.