TabRowDefaults


Contains default implementations and values used for TabRow.

Summary

Constants

const Float

Default opacity for the color of Divider

Cmn

Public functions

Unit
@Composable
Divider(modifier: Modifier, thickness: Dp, color: Color)

Default Divider, which will be positioned at the bottom of the TabRow, underneath the indicator.

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

Default 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

Default thickness for Divider

Cmn
Dp

Default height for Indicator

Cmn
Dp

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

Cmn

Constants

DividerOpacity

const val DividerOpacity = 0.12f: Float

Default opacity for the color of Divider

Public functions

Divider

@Composable
fun Divider(
    modifier: Modifier = Modifier,
    thickness: Dp = DividerThickness,
    color: Color = LocalContentColor.current.copy(alpha = DividerOpacity)
): Unit

Default Divider, which will be positioned at the bottom of the TabRow, underneath the indicator.

Parameters
modifier: Modifier = Modifier

modifier for the divider's layout

thickness: Dp = DividerThickness

thickness of the divider

color: Color = LocalContentColor.current.copy(alpha = DividerOpacity)

color of the divider

Indicator

@Composable
fun Indicator(
    modifier: Modifier = Modifier,
    height: Dp = IndicatorHeight,
    color: Color = LocalContentColor.current
): 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 = IndicatorHeight

height of the indicator

color: Color = LocalContentColor.current

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

DividerThickness

val DividerThicknessDp

Default thickness for Divider

IndicatorHeight

val IndicatorHeightDp

Default height for Indicator

ScrollableTabRowPadding

val ScrollableTabRowPaddingDp

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