TabRowScope


@ExperimentalTvMaterial3Api
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
@ExperimentalTvMaterial3Api
@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-alpha10
val hasFocusBoolean

Whether any Tab within the TabRow is focused

Extension functions

@ExperimentalTvMaterial3Api
@Composable
fun TabRowScope.Tab(
    selected: Boolean,
    onFocus: () -> Unit,
    modifier: Modifier = Modifier,
    onClick: () -> Unit = { },
    enabled: Boolean = true,
    colors: TabColors = TabDefaults.pillIndicatorTabColors(),
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    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 = remember { MutableInteractionSource() }

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.

content: @Composable RowScope.() -> Unit

content of the Tab