Tab

fun Tab(selected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, text: String? = null, icon: SparkIcon? = null, contentDescription: String? = null, enabled: Boolean = true, intent: TabIntent = TabDefaults.SelectedContentIntent, size: TabSize = TabDefaults.Size, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, trailingContent: @Composable () -> Unit = {})

Spark tab.

Tabs organize content across different screens, data sets, and other interactions. This Tab has specific slots for text and / or an icon, and optional trailing content

Parameters

selected

whether this tab is selected or not

onClick

called when this tab is clicked

modifier

the Modifier to be applied to this tab

text

label to be displayed

icon

SparkIcon to be displayed before the text or as the main content

contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless text is provided. This description should be localized, such as by using androidx.compose.ui.res.stringResource or similar

enabled

controls the enabled state of this tab. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

intent

TabIntent used to highlight the selected tab

size

TabSize to apply to the tab

interactionSource

the MutableInteractionSource representing the stream of Interactions for this tab. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this tab in different states.

trailingContent

optional trailing content, typically a [com.adevinta.