SegmentedTabs

fun SegmentedTabs(tabs: List<String>, selectedIndex: Int, onTabClick: (index: Int) -> Unit, modifier: Modifier = Modifier)

Segmented tabs are a set of related tabs with a shared container, used to display different content views. They are mutually exclusive, meaning only one tab can be selected at a time.

If there are less than two tabs, no tab will be displayed. If there are more than three tabs, only the first three will be displayed.

The Segmented tabs offers three sizes:

Two tabs

Two segmented tabs

Three tabs

Three segmented tabs

Parameters

tabs

The list of strings to be displayed as tabs.

selectedIndex

The index of the currently selected tab.

onTabClick

The callback to be invoked when a tab is clicked. The index of the clicked tab is passed as a parameter.

modifier

An optional Modifier to be applied to the segmented tabs. Defaults to Modifier.