TabRowScope

interface TabRowScope


TabRowScope is used to provide the doesTabRowHaveFocus state to the Tab composable

Summary

Public properties

Boolean

Whether any Tab within the TabRow is focused

Extension functions

Unit
@Composable
TabRowScope.Tab(
    selected: Boolean,
    onFocus: () -> Unit,
    modifier: Modifier,
    onClick: () -> Unit,
    enabled: Boolean,
    colors: TabColors,
    interactionSource: MutableInteractionSource?,
    content: @Composable RowScope.() -> Unit
)

Material Design tab.

Public properties

hasFocus

Added in 1.0.0
val hasFocusBoolean

Whether any Tab within the TabRow is focused

Extension functions

@Composable
fun TabRowScope.Tab(
    selected: Boolean,
    onFocus: () -> Unit,
    modifier: Modifier = Modifier,
    onClick: () -> Unit = {},
    enabled: Boolean = true,
    colors: TabColors = TabDefaults.pillIndicatorTabColors(),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit
): Unit

Material Design tab.

A default Tab, also known as a Primary Navigation Tab. Tabs organize content across different screens, data sets, and other interactions.

This should typically be used inside of a TabRow, see the corresponding documentation for example usage.

Parameters
selected: Boolean

whether this tab is selected or not

onFocus: () -> Unit

called when this tab is focused

modifier: Modifier = Modifier

the Modifier to be applied to this tab

onClick: () -> Unit = {}

called when this tab is clicked (with D-Pad Center)

enabled: Boolean = true

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.

colors: TabColors = TabDefaults.pillIndicatorTabColors()

these will be used by the tab when in different states (focused, selected, etc.)

interactionSource: MutableInteractionSource? = null

an optional hoisted MutableInteractionSource for observing and emitting Interactions for this tab. You can use this to change the tab's appearance or preview the tab in different states. Note that if null is provided, interactions will still happen internally.

content: @Composable RowScope.() -> Unit

content of the Tab