Strata UI

Quick rating

Community listing page, reviews here may not be monitored by the author.

Strata UI

No reviews yet

Declarative, reusable Minecraft UI with headless rendering and exact versioned Fabric adapters.

Mod Loaders
Minecraft
26.2

About

Description

Strata UI

Strata is a declarative UI library for Minecraft Fabric Mods. Build screens from reusable components, keep application state in your own code, and test UI behavior without launching Minecraft. A separately installed runtime connects those definitions to the client version and its resources.

What you can build

  • Arrange controls with layouts that measure and place their children.
  • Combine text, inputs, scrolling lists, images, and Minecraft inventory bindings into application screens.
  • Add sizing, appearance, focus, and input behavior through composable modifiers.
  • Reuse screen definitions in headless tests and the Minecraft client.
  • Compose your own components, or extend the public Element and Node contracts for retained behavior.

Browse the component catalog for images, compiled examples, and individual API links.

Install and open a screen

Compile ordinary Mod source against the API only, then install the runtime matching the active Minecraft version together with Fabric Language Kotlin.

dependencies {
    compileOnly("dev.s7a.strata:strata-api:0.1.6")
    modRuntimeOnly("dev.s7a.strata:strata-runtime-minecraft-fabric-<minecraft-version>:0.1.6")
    modRuntimeOnly("net.fabricmc:fabric-language-kotlin:<compatible-version>")
}

Declare strata as a required dependency in the consuming Mod's fabric.mod.json. The following exact example is compiled against strata-api alone and is also used by the README and public Strata skill:

import dev.s7a.strata.component.Button
import dev.s7a.strata.component.Column
import dev.s7a.strata.component.Text
import dev.s7a.strata.layout.HorizontalAlignment
import dev.s7a.strata.modifier.Modifier
import dev.s7a.strata.modifier.menuBackground
import dev.s7a.strata.modifier.onActivate
import dev.s7a.strata.modifier.padding
import dev.s7a.strata.modifier.size
import dev.s7a.strata.screen.ScreenDefinition

/**
 * Opens a confirmation screen on the installed runtime's owner thread.
 */
internal fun openConfirmationScreen(onConfirm: () -> Unit) {
    ScreenDefinition("Confirm action") {
        Column(
            modifier =
                Modifier.Empty
                    .size(320, 180)
                    .menuBackground()
                    .padding(12),
            spacing = 8,
            horizontalAlignment = HorizontalAlignment.Center,
        ) {
            Text("Continue with this action?")
            Button(
                "Yes",
                modifier = Modifier.Empty.onActivate(onConfirm),
            )
        }
    }.open()
}

Supported Minecraft versions

1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.2

Install exactly one Strata runtime matching the client version. See Minecraft compatibility for artifact names and Java requirements.

Documentation and source

Generative AI substantially assisted implementation, review, tests, documentation, and release-page text. The maintainer directed the design and validates release artifacts through the public test suite.