UiScope

sealed class UiScope(source)

Callback-lifetime scope used to emit immutable element descriptions. A scope is confined to the thread that constructs it and remains valid only while its enclosing component callback is running. The scope temporarily retains references to caller-owned immutable Element instances and the builder returns the exact single root instance. The protected constructor is reserved for scope implementations in this module and package, as required by Kotlin's sealed hierarchy rules. Application code cannot construct or implement this sealed scope.

Inheritors

Functions

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

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

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

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

Link copied to clipboard
fun UiScope.Canvas(source: CanvasSource, size: IntSize, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one input-passive rectangular region displaying an externally owned source.

Link copied to clipboard
fun UiScope.Checkbox(label: UiText, state: CheckboxState, width: Int = 150, enabled: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one Minecraft-profile Checkbox backed by caller-owned state.

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

Literal-label overload of Checkbox.

Link copied to clipboard
fun UiScope.Column(modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, spacing: Int = 0, verticalArrangement: Arrangement = Arrangement.Start, horizontalAlignment: HorizontalAlignment = HorizontalAlignment.Start, content: ColumnScope.() -> Unit)

Emits one column container with the descriptions produced by its callback.

Link copied to clipboard
fun <T : Any> UiScope.CycleButton(state: CycleButtonState<T>, width: Int = 150, enabled: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, label: (T) -> UiText = { value -> UiText.Literal(state.formatKnownMember(value)) })

Emits one finite-option Minecraft-profile CycleButton.

Link copied to clipboard
fun element(element: Element)

Emits one immutable element description. The element is retained by this callback-lifetime scope without being copied, wrapped, registered, or dispatched by component type. The call must run on the scope's constructing thread while its enclosing callback is active.

Link copied to clipboard
fun UiScope.FlowRow(modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, horizontalSpacing: Int = 0, verticalSpacing: Int = 0, horizontalArrangement: Arrangement = Arrangement.Start, verticalAlignment: VerticalAlignment = VerticalAlignment.Top, content: FlowRowScope.() -> Unit)

Emits horizontal children that wrap into rows when their measured widths and gaps exceed a bounded width.

Link copied to clipboard
fun UiScope.Grid(columns: Int, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, horizontalSpacing: Int = 0, verticalSpacing: Int = 0, contentAlignment: Alignment = Alignment.TopStart, content: GridScope.() -> Unit)

Emits one fixed-column grid with the descriptions produced by its callback.

Link copied to clipboard
fun UiScope.Image(source: ImageSource, size: IntSize? = null, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one immutable nearest-sampled image component.

fun UiScope.Image(source: ImageSource, sourceRegion: IntRect, size: IntSize = IntSize(sourceRegion.width, sourceRegion.height), modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one immutable nearest-sampled source region from an image.

Link copied to clipboard
fun UiScope.LoadingIndicator(size: IntSize = IntSize(10, 4), modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits the active Minecraft profile's discrete loading animation.

Link copied to clipboard
fun UiScope.PlayerHead(source: PlayerSkinSource = PlayerSkinSource.CurrentPlayer, scale: PlayerHeadScale, showHat: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, loadingContent: UiScope.() -> Unit? = null, failureContent: UiScope.() -> Unit? = null)

Emits one square layered player head at a pixel-perfect integer scale.

fun UiScope.PlayerHead(source: PlayerSkinSource = PlayerSkinSource.CurrentPlayer, size: Int = 24, showHat: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, loadingContent: UiScope.() -> Unit? = null, failureContent: UiScope.() -> Unit? = null)

Emits one square layered player head at an arbitrary logical size.

Link copied to clipboard
fun UiScope.ProgressBar(progress: Double, size: IntSize = IntSize(100, 12), modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one determinate Minecraft-profile progress bar.

Link copied to clipboard
fun UiScope.Row(modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, spacing: Int = 0, horizontalArrangement: Arrangement = Arrangement.Start, verticalAlignment: VerticalAlignment = VerticalAlignment.Top, content: RowScope.() -> Unit)

Emits one row container with the descriptions produced by its callback.

Link copied to clipboard
fun UiScope.ScrollArea(state: ScrollState, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, scrollRate: Int = 9, content: UiScope.() -> Unit)

Emits one profile-backed scroll viewport containing exactly one root.

Link copied to clipboard
fun UiScope.Scrollbar(state: ScrollState, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one independently placed profile-backed vertical scrollbar linked to state.

Link copied to clipboard
fun <T : Any, K : Any> UiScope.SelectionList(items: List<T>, keyOf: (T) -> K, state: SelectionListState<K>, viewportSize: IntSize, rowHeight: Int, canLoadLeading: Boolean = false, canLoadTrailing: Boolean = false, scrollRate: Int = 10, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: UiScope.(T) -> Unit)

Emits a selectable fixed-row virtual list backed by an immutable in-memory snapshot.

Link copied to clipboard
fun UiScope.Slider(label: UiText, state: SliderState, width: Int = 150, enabled: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one horizontal Minecraft-profile Slider backed by caller-owned state.

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

Literal-label overload of Slider.

Link copied to clipboard
fun UiScope.Slot(bind: SlotBinding? = null, highlightable: Boolean = true, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: UiScope.() -> Unit? = null)

Emits one 18 by 18 inventory slot with an optional item root or synchronized binding.

Link copied to clipboard
fun UiScope.Spacer(modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one empty spacer component.

Link copied to clipboard
fun UiScope.Stack(modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, contentAlignment: Alignment = Alignment.TopStart, content: StackScope.() -> Unit)

Emits one overlay stack with the descriptions produced by its callback.

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

Emits one externally controlled tab.

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

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

Link copied to clipboard
fun UiScope.Text(text: UiText, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one single-line profile-backed text component.

fun UiScope.Text(text: String, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one literal single-line profile-backed text component.

fun UiScope.Text(text: UiText, font: ResourceId, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one single-line text component using an explicitly selected resource-pack font.

fun UiScope.Text(text: UiText, layout: TextLayout, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one profile-backed text component with an explicit single-line or multiline layout.

fun UiScope.Text(text: String, font: ResourceId, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one literal single-line text component using an explicitly selected resource-pack font.

fun UiScope.Text(text: String, layout: TextLayout, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Literal overload of Text with the same explicit layout, ownership, and failure contract.

fun UiScope.Text(text: UiText, layout: TextLayout, font: ResourceId, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits explicitly laid-out text using a selected resource-pack font.

fun UiScope.Text(text: String, layout: TextLayout, font: ResourceId, style: TextStyle = TextStyle.Normal, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Literal overload of Text with the same explicit layout and font-selection contract.

Link copied to clipboard
fun UiScope.TextArea(state: TextAreaState, viewport: TextAreaViewport, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, wrap: TextWrap = TextWrap.Word, lineSpacing: Int = 0, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one multiline editor with independently placeable vertical scrolling.

fun UiScope.TextArea(state: TextAreaState, viewport: TextAreaViewport, font: ResourceId, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, wrap: TextWrap = TextWrap.Word, lineSpacing: Int = 0, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one multiline editor using an explicitly selected resource-pack font.

Link copied to clipboard
fun UiScope.TextField(state: TextFieldState, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one 200 by 20 single-line text field.

fun UiScope.TextField(state: TextFieldState, size: IntSize, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one explicitly sized single-line text field.

fun UiScope.TextField(state: TextFieldState, font: ResourceId, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one 200 by 20 single-line text field using an explicitly selected resource-pack font.

fun UiScope.TextField(state: TextFieldState, size: IntSize, font: ResourceId, enabled: Boolean = true, textStyle: TextStyle = TextStyle.TextField, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null)

Emits one explicitly sized single-line text field using a selected resource-pack font.

Link copied to clipboard
fun UiScope.TiledImage(source: TiledImageSource, state: PanZoomState, size: IntSize, fit: PanZoomFit = PanZoomFit.Contain, cachePolicy: TiledImageCachePolicy = TiledImageCachePolicy.Default, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: TiledImageScope.() -> Unit = {})

Emits one fixed viewport over a logical raster assembled from independently revisioned image tiles.

Link copied to clipboard
fun <T : Any, K : Any> UiScope.VirtualList(items: List<T>, keyOf: (T) -> K, state: VirtualListState<K>, viewportSize: IntSize, rowHeight: Int, scrollRate: Int = 10, canLoadLeading: Boolean = false, canLoadTrailing: Boolean = false, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: UiScope.(T) -> Unit)

Emits a fixed-row virtual viewport backed by an immutable in-memory list.

fun <T : Any, K : Any> UiScope.VirtualList(itemCount: () -> Int, itemAt: (Int) -> T, keyAt: (Int) -> K, state: VirtualListState<K>, viewportSize: IntSize, rowHeight: Int, indexOfKey: (K) -> Int?? = null, scrollRate: Int = 10, canLoadLeading: Boolean = false, canLoadTrailing: Boolean = false, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: UiScope.(T) -> Unit)

Emits a fixed-row virtual viewport backed by a caller-owned dynamic indexed source.

fun <T : Any, K : Any> UiScope.VirtualList(itemCount: Int, itemAt: (Int) -> T, keyAt: (Int) -> K, state: VirtualListState<K>, viewportSize: IntSize, rowHeight: Int, indexOfKey: (K) -> Int? = { target -> (0 until itemCount).firstOrNull { index -> keyAt(index) == target } }, scrollRate: Int = 10, canLoadLeading: Boolean = false, canLoadTrailing: Boolean = false, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, content: UiScope.(T) -> Unit)

Emits a fixed-row virtual viewport backed by a known finite indexed source.