Button

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

Emits one fixed-height profile-backed button appearance and semantic surface.

The component does not install focus or activation implicitly. Compose onActivate with the same enabled state when primary pointer and focused Enter or Space presses represent one action, or use pointer modifiers for pointer-specific behavior.

Receiver

active owner-thread screen scope.

Parameters

label

unresolved button label.

width

requested logical width.

enabled

whether enabled appearance and semantics are used.

modifier

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

key

optional stable sibling identity.

Throws

when the label does not fit or width is incompatible with the profile.

when no runtime screen evaluation is active.


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

Emits one literal fixed-height profile-backed button appearance and semantic surface.

Like the typed-label overload, this component installs neither focus nor activation.

Receiver

active owner-thread screen scope.

Parameters

label

literal converted to UiText.Literal.

width

requested logical width.

enabled

whether enabled appearance and semantics are used.

modifier

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

key

optional stable sibling identity.

Throws

when the label does not fit or width is incompatible with the profile.

when no runtime screen evaluation is active.