Object

TabRowDefaults

Contains default implementations and values used for TabRow.

Source set: Common

Added in 1.11.0-rc01

object TabRowDefaults

Contains default implementations and values used for TabRow.

Properties

DividerOpacity

Source set: Common

Added in 1.11.0-rc01

const val DividerOpacity = 0.12f

Default opacity for the color of Divider

DividerThickness

Source set: Common

Added in 1.11.0-rc01

val DividerThickness = 1.dp

Default thickness for Divider

IndicatorHeight

Source set: Common

Added in 1.11.0-rc01

val IndicatorHeight = 2.dp

Default height for Indicator

ScrollableTabRowPadding

Source set: Common

Added in 1.11.0-rc01

val ScrollableTabRowPadding = 52.dp

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

Functions

Divider

Divider

Added in 1.11.0-rc01

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

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

Parameters

modifier modifier for the divider's layout
thickness thickness of the divider
color color of the divider

Indicator


Indicator

Added in 1.11.0-rc01

@Composable
    fun Indicator(
        modifier: Modifier = Modifier,
        height: Dp = IndicatorHeight,
        color: Color = LocalContentColor.current,
    )

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

tabIndicatorOffset


tabIndicatorOffset

Added in 1.11.0-rc01

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: