TabRowDefaults

object TabRowDefaults


Contains default implementations and values used for TabRow.

Summary

Constants

const Float

Default opacity for the color of Divider

Public functions

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

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

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

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

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.

Public properties

Dp

Default thickness for Divider

Dp

Default height for Indicator

Dp

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

Constants

DividerOpacity

const val DividerOpacityFloat

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)
): @Composable 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
): @Composable 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.