Package-level declarations

Types

Link copied to clipboard
class Modifier

Immutable ordered active modifier descriptions.

Link copied to clipboard
interface ModifierElement

Immutable value description for one active modifier node.

Link copied to clipboard
class ModifierNodeType<E : ModifierElement, N : ModifierNode>(elementClass: KClass<E>, nodeClass: KClass<out N>, validateLocal: (E) -> Unit, createNode: (E) -> N, updateNode: (E, E, N) -> DirtyMask)

Stable referential token and typed bridge for one modifier description and node pair.

Functions

Link copied to clipboard

Captures the typed action handlers declared directly on this modifier chain.

Link copied to clipboard

Paints a color across the modifier's complete local bounds before its content. The new behavior is appended inside the existing modifier chain, so existing outer paint behavior remains earlier.

Link copied to clipboard

Sizes the modified component to a Minecraft 26.2 generic chest panel and paints its background before content.

Link copied to clipboard

Fills a bounded parent height while preserving an unbounded height. The new behavior is appended inside the existing modifier chain and leaves the width policy unchanged.

Link copied to clipboard

Fills every bounded parent axis while preserving unbounded axes. The new behavior is appended inside the existing modifier chain.

Link copied to clipboard

Fills a bounded parent width while preserving an unbounded width. The new behavior is appended inside the existing modifier chain and leaves the height policy unchanged.

Link copied to clipboard

Makes the logical component a keyboard and text-input focus target.

Link copied to clipboard
fun Modifier.height(height: Int): Modifier

Constrains the height to an exact requested size after clamping it into the parent constraints. The new behavior is appended inside the existing modifier chain and leaves the width policy unchanged.

Link copied to clipboard
fun Modifier.heightIn(min: Int = 0, max: Int = Int.MAX_VALUE): Modifier

Constrains the height to an independently clamped inclusive range. A requested range disjoint from its parent range is pinned to the nearest parent boundary. Int.MAX_VALUE remains an unbounded maximum, and the new behavior is appended inside the existing modifier chain.

Link copied to clipboard
fun Modifier.imageBackground(source: ImageSource, scale: ImageScale = ImageScale.Stretch): Modifier

Paints arbitrary immutable image pixels behind the modified component's content.

fun Modifier.imageBackground(source: ImageSource, border: Insets, centerMode: NineSliceCenterMode = NineSliceCenterMode.Tiled): Modifier

Paints arbitrary immutable image pixels as a Minecraft-compatible nine-slice background behind content.

Link copied to clipboard

Makes the logical component the initial focus target when layout has no retained focus owner.

Link copied to clipboard

Paints the selected Minecraft menu texture behind the modified component's content.

Link copied to clipboard
fun <T : Any> Modifier.onAction(key: ActionKey<T>, callback: UiSession.(T) -> ActionResult): Modifier

Handles one typed component action emitted by the component wrapped by this modifier.

Link copied to clipboard

Runs one action for a primary pointer press or a focused Enter or Space press and consumes that event.

Keeps activation attached while its enabled value follows a frame-committed source. Pass the same source to the component's enabled argument when appearance and input must agree. Unlike the Boolean overload, a false source retains the action so it can become enabled without rebuilding its parent. Notifications never dispatch actions; pointer and keyboard input use the last committed value on the owner thread. The caller owns the source. Replacement, disposal, failure, and close release the runtime observation and action.

fun Modifier.onActivate(enabled: Boolean, action: UiSession.() -> Unit): Modifier

Conditionally installs the shared pointer and keyboard activation behavior from onActivate.

Link copied to clipboard

Handles pointer events and captures the button whose press this handler consumes.

Captures button locally when its press reaches this modifier and sends typed gesture notifications to its owner. Matching presses, movement, scrolling, and matching-button drag/release events are consumed immediately. Other buttons continue ordinary dispatch. Captured coordinates may lie outside the modifier bounds. Changing the button leaves an active gesture attached to its original subscription until release or cancellation. A remote subscription change retires its endpoints, so that old gesture cannot invoke replacement handlers. onCancel runs on the owner thread for interrupted gestures; it is not called for an ordinary release.

Link copied to clipboard

Adds a focused committed-character callback.

Subscribes to typed text notifications while deciding propagation immediately on the client. action runs on the screen owner thread, on Paper for a remote screen, and returns no dispatch decision. IME state remains local; only the requested event variant is sent to the server.

Link copied to clipboard

Handles and consumes Checkbox selected-value changes.

Link copied to clipboard
fun <T : Any> Modifier.onCycle(action: UiSession.(T) -> Unit): Modifier

Handles and consumes typed CycleButton value changes.

Link copied to clipboard
fun Modifier.onDrag(action: UiSession.() -> Unit): Modifier

Runs action for every pointer drag that hits this modifier without consuming the event.

Handles every pointer drag that hits this modifier's laid-out bounds.

fun Modifier.onDrag(propagation: InputResult, button: PointerButton? = null, action: UiSession.(PointerEvent.Drag, IntOffset) -> Unit): Modifier

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Adds a callback for distinct retained focus transitions and makes the logical component focusable.

Link copied to clipboard

Observes distinct pointer enter and exit transitions for this modifier's laid-out bounds.

Link copied to clipboard

Adds a focused callback for every key press and release.

fun Modifier.onKeyEvent(propagation: InputResult, filter: KeyboardInputFilter = KeyboardInputFilter(), action: UiSession.(KeyboardEvent) -> Unit): Modifier

Subscribes to typed keyboard notifications with a fixed immediate dispatch result. Only events matching filter invoke action or cross a remote connection; other events continue propagation. The handler runs on the screen owner thread, on the hosting server or proxy when the screen is remote. propagation is decided locally without waiting for that handler; dynamic result callbacks use the other overload.

Link copied to clipboard

Adds a focused key-press callback.

fun Modifier.onKeyPress(propagation: InputResult, filter: KeyboardInputFilter = KeyboardInputFilter(), action: UiSession.(KeyboardEvent.Press) -> Unit): Modifier

Subscribes to typed keyboard notifications with a fixed immediate dispatch result. Only events matching filter invoke action or cross a remote connection; other events continue propagation. The handler runs on the screen owner thread, on the hosting server or proxy when the screen is remote. propagation is decided locally without waiting for that handler; dynamic result callbacks use the other overload.

Link copied to clipboard

Adds a focused key-release callback.

fun Modifier.onKeyRelease(propagation: InputResult, filter: KeyboardInputFilter = KeyboardInputFilter(), action: UiSession.(KeyboardEvent.Release) -> Unit): Modifier

Subscribes to typed keyboard notifications with a fixed immediate dispatch result. Only events matching filter invoke action or cross a remote connection; other events continue propagation. The handler runs on the screen owner thread, on the hosting server or proxy when the screen is remote. propagation is decided locally without waiting for that handler; dynamic result callbacks use the other overload.

Link copied to clipboard

Handles and consumes demand for rows before a virtual list's loaded window.

Link copied to clipboard
fun Modifier.onMove(action: UiSession.() -> Unit): Modifier

Runs action for every pointer move that hits this modifier without consuming the event.

Handles every pointer move that hits this modifier's laid-out bounds.

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Handles every typed pointer event that hits this modifier's laid-out bounds.

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Adds a focused input-method preedit callback.

Subscribes to typed text notifications while deciding propagation immediately on the client. action runs on the screen owner thread, on Paper for a remote screen, and returns no dispatch decision. IME state remains local; only the requested event variant is sent to the server.

Link copied to clipboard
fun Modifier.onPress(action: UiSession.() -> Unit): Modifier

Runs action for every primary pointer press that hits this modifier and consumes the event. Other button presses remain ignored so lower or earlier handlers can process them.

Handles every pointer press that hits this modifier's laid-out bounds.

fun Modifier.onPress(propagation: InputResult, button: PointerButton? = null, action: UiSession.(PointerEvent.Press, IntOffset) -> Unit): Modifier

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Runs action for every pointer release that hits this modifier and consumes the event.

Handles every pointer release that hits this modifier's laid-out bounds.

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Runs action for every pointer scroll event that hits this modifier and consumes the event.

Handles every pointer scroll event that hits this modifier's laid-out bounds.

Subscribes to typed pointer notifications within the modifier's hit region, including local coordinates. propagation is applied immediately; action runs on the screen owner thread, on the hosting server or proxy for remote screens. Only the subscribed event variant and optional button are delivered or transmitted.

Link copied to clipboard

Handles and consumes typed SelectionList key changes.

Link copied to clipboard

Handles and consumes Slider numeric-value changes.

Link copied to clipboard

Adds a focused callback for both committed characters and input-method preedit updates.

Subscribes to typed text notifications while deciding propagation immediately on the client. action runs on the screen owner thread, on Paper for a remote screen, and returns no dispatch decision. IME state remains local; only the requested event variant is sent to the server.

Link copied to clipboard

Handles and consumes demand for rows after a virtual list's loaded window.

Link copied to clipboard

Adds checked distances around the virtual child. The new behavior is appended inside the existing modifier chain. Measurement reports an ArithmeticException if a measured child extent plus the checked inset total overflows.

Adds one distance around every side of the virtual child. The new behavior is appended inside the existing modifier chain.

fun Modifier.padding(horizontal: Int, vertical: Int): Modifier

Adds equal horizontal and equal vertical distances around the virtual child. The new behavior is appended inside the existing modifier chain.

fun Modifier.padding(left: Int = 0, top: Int = 0, right: Int = 0, bottom: Int = 0): Modifier

Adds independently specified distances around the virtual child. Unspecified sides default to zero, and the new behavior is appended inside the existing modifier chain.

Link copied to clipboard
fun Modifier.panZoom(state: PanZoomState, panButton: PointerButton = PointerButton.Primary, zoomStep: Double = 1.12): Modifier

Adds captured pointer panning and pointer-anchored scroll zooming.

Link copied to clipboard
fun Modifier.scaleToFit(contentSize: IntSize, contentAlignment: Alignment = Alignment.Center, allowUpscaling: Boolean = false): Modifier

Measures the modified component subtree in a fixed content coordinate space and uniformly scales it to fit the resulting outer bounds without cropping.

Link copied to clipboard

Emits one separate unresolved semantics entry before entries produced by the modifier's content. The new behavior is appended inside the existing modifier chain, so existing outer entries remain earlier.

Link copied to clipboard
fun Modifier.size(width: Int, height: Int): Modifier

Constrains both axes to exact requested sizes after clamping them into the parent constraints. The new behavior is appended inside the existing modifier chain.

Link copied to clipboard
fun Modifier.sizeIn(minWidth: Int = 0, minHeight: Int = 0, maxWidth: Int = Int.MAX_VALUE, maxHeight: Int = Int.MAX_VALUE): Modifier

Constrains both axes to independently clamped inclusive ranges. A requested range disjoint from its parent range is pinned to the nearest parent boundary. Int.MAX_VALUE remains an unbounded maximum, and the new behavior is appended inside the existing modifier chain.

Link copied to clipboard
fun Modifier.tooltip(text: UiText, delayMillis: Long = 500): Modifier

Shows a profile-backed root tooltip while the modified element remains hovered.

fun Modifier.tooltip(text: String, delayMillis: Long = 500): Modifier

Literal-text overload of tooltip.

Link copied to clipboard
fun Modifier.width(width: Int): Modifier

Constrains the width to an exact requested size after clamping it into the parent constraints. The new behavior is appended inside the existing modifier chain and leaves the height policy unchanged.

Link copied to clipboard
fun Modifier.widthIn(min: Int = 0, max: Int = Int.MAX_VALUE): Modifier

Constrains the width to an independently clamped inclusive range. A requested range disjoint from its parent range is pinned to the nearest parent boundary. Int.MAX_VALUE remains an unbounded maximum, and the new behavior is appended inside the existing modifier chain.