JengaTabs

fun JengaTabs(selectedIndex: Int, tabs: List<String>, onSelect: (Int) -> Unit, modifier: Modifier = Modifier, arrangement: JengaTabsArrangement = JengaTheme.components.tabs?.arrangement ?: JengaTabsArrangement.Fill, dotted: Set<Int> = emptySet(), textStyle: TextStyle = JengaTabsDefaults.textStyle, minHeight: Dp = JengaTheme.components.tabs?.minHeight ?: JengaTabsDefaults.MinHeight, spacing: Dp = JengaTabsDefaults.spacing, contentPadding: PaddingValues = JengaTabsDefaults.contentPadding, colors: JengaTabsColors = JengaTabsDefaults.colors(), selectedTextStyle: TextStyle = textStyle.merge(JengaTheme.components.tabs?.selectedTextStyle))(source)

A row of text tabs with an underline indicator under the selected tab.

Parameters

selectedIndex

the index of the selected tab.

tabs

the tab titles.

onSelect

called with the index of a tapped tab.

modifier

the Modifier for the tab row.

arrangement

how the tabs are laid out; see JengaTabsArrangement. Defaults to the theme's arrangement, else JengaTabsArrangement.Fill.

dotted

indices of tabs that show a small dot after their label (e.g. needs attention).

textStyle

the tab label text style.

minHeight

the minimum tab height; defaults to the theme's value, else JengaTabsDefaults.MinHeight.

spacing

gap between tabs with JengaTabsArrangement.Start.

contentPadding

padding around the row of tabs.

colors

the color set; defaults to JengaTabsDefaults.colors.

selectedTextStyle

the label text style of the selected tab; defaults to textStyle with the theme's JengaTabsStyle.selectedTextStyle merged on top.

Samples

JengaTabs(
    selectedIndex = 0,
    tabs = listOf(
        "Upcoming",
        "Past",
    ),
    onSelect = { },
)