Tab

fun UiScope.Tab(label: UiText, selected: Boolean, width: Int = 150, enabled: Boolean = true, indicator: TabSelectionIndicator = TabSelectionIndicator.Underline, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)(source)

Emits one externally controlled tab.

The component renders indicator only while selected is true and emits matching tab semantics. It installs neither focus nor activation; compose onActivate with the same enabled state for a shared primary-pointer and focused Enter-or-Space action, while pointer-specific actions remain ordinary modifier behavior.

Receiver

active owner-thread screen scope.

Parameters

label

unresolved tab label.

selected

externally owned selected state.

width

requested logical width.

enabled

whether enabled appearance, hover, and semantics are used.

indicator

selected-state presentation.

modifier

active behavior including caller-owned focus, activation, and pointer actions.

key

optional stable sibling identity.

Throws

when a custom indicator does not emit exactly one root.

when no runtime screen evaluation is active.


fun UiScope.Tab(label: String, selected: Boolean, width: Int = 150, enabled: Boolean = true, indicator: TabSelectionIndicator = TabSelectionIndicator.Underline, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)(source)

Literal overload of Tab with the same ownership, failure, and no-implicit-focus-or-activation contract.