Common
object TabRowDefaults
Contains default implementations and values used for TabRow.
Properties
Common
const val DividerOpacity = 0.12f
Default opacity for the color of Divider
Common
val DividerThickness = 1.dp
Default thickness for Divider
Common
val IndicatorHeight = 2.dp
Default height for Indicator
Common
val ScrollableTabRowPadding = 52.dp
The default padding from the starting edge before a tab in a ScrollableTabRow.
Functions
Divider
@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
@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
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. |