Google is committed to advancing racial equity for Black communities. See how.

TabConstants

object TabConstants
kotlin.Any
   ↳ androidx.compose.material.TabConstants

Contains default values used by tabs from the Material specification.

Summary

Constants
const Float

Default opacity for the color of DefaultDivider

Public methods
Unit
DefaultDivider(modifier: Modifier = Modifier, thickness: Dp = DefaultDividerThickness, color: Color = contentColor().copy(alpha = DefaultDividerOpacity))

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

Unit
DefaultIndicator(modifier: Modifier = Modifier, height: Dp = DefaultIndicatorHeight, color: Color = contentColor())

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.

Properties
Dp

Default thickness for DefaultDivider

Dp

Default height for DefaultIndicator

Dp

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

Constants

DefaultDividerOpacity

const val DefaultDividerOpacity: Float

Default opacity for the color of DefaultDivider

Value: 0.12f

Public methods

DefaultDivider

@Composable fun DefaultDivider(
    modifier: Modifier = Modifier,
    thickness: Dp = DefaultDividerThickness,
    color: Color = contentColor().copy(alpha = DefaultDividerOpacity)
): 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 = DefaultDividerThickness thickness of the divider
color: Color = contentColor().copy(alpha = DefaultDividerOpacity) color of the divider

DefaultIndicator

@Composable fun DefaultIndicator(
    modifier: Modifier = Modifier,
    height: Dp = DefaultIndicatorHeight,
    color: Color = contentColor()
): 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 = DefaultIndicatorHeight height of the indicator
color: Color = contentColor() color of the indicator

defaultTabIndicatorOffset

fun Modifier.defaultTabIndicatorOffset(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.

Properties

DefaultDividerThickness

val DefaultDividerThickness: Dp

Default thickness for DefaultDivider

DefaultIndicatorHeight

val DefaultIndicatorHeight: Dp

Default height for DefaultIndicator

DefaultScrollableTabRowPadding

val DefaultScrollableTabRowPadding: Dp

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