Skip to content
PerrierBottle edited this page May 10, 2026 · 3 revisions

Modding Library

A declarative, reactive UI component library for Minecraft 1.21.4 Fabric mods, written in Java 21. Build screens by composing components instead of subclassing Screen and writing imperative init() / render() boilerplate.

import static org.triggersstudio.moddinglib.client.ui.api.Components.*;
import static org.triggersstudio.moddinglib.client.ui.styling.Styles.*;

State<Integer> counter = State.of(0);

UIScreen screen = Screen(Column(
        padding(20).backgroundColor(0xFF_1A_1A_1A).build(),

        Text(counter.map(v -> "Counter: " + v),
             fontSize(16).textColor(WHITE).build()),

        Button("+1", height(28)
                .onClick((x, y, btn) -> counter.set(counter.get() + 1))
                .build())
));

MinecraftClient.getInstance().setScreen(screen);

What's inside

  • Composition APIComponents.Row(...), Components.Column(...), vararg children or Consumer<ContainerScope> builders.
  • Reactive stateState<T> with map, combine, bindBidirectional, automatic threading hop to the render thread.
  • Rich components — Text, Button, Image, TextField, TextArea, Sliders (5 numeric types), ProgressBar, Pagination, Accordion, ComboBox, SelectList, Calendar, ColorPicker, Skeleton, Spinner, Tooltip, Toast, Charts (Line/Bar/Pie), PlayerRender.
  • Animations — Tween (time-based) and Spring (physics) interpolators, full Penner easing family, Bezier and step curves, ColorTween for ARGB. FadeIn, FadeOut, SlideIn shortcuts.
  • StylingStyle.Builder with size, padding, margin, background, border, radius, opacity, font, alignment, click handler.

Read next

  • Getting Started — install + your first screen.
  • ConceptsUIComponent, State<T>, lifecycle, focus, layout flow.
  • StylingStyle.Builder, helpers, color constants.
  • Components — index of every component, organized by family.
  • AnimationsTween, Spring, Easing, ColorTween.
  • Devmode & Examples/demomenu subcommands and bundled example screens.

Status

  • Minecraft: 1.21.4
  • Fabric Loader: 0.17.2
  • Java: 21

For the canonical roadmap (shipped / on side branch / planned / under discussion), see FEATURES.md in the main repo.

Clone this wiki locally