-
Notifications
You must be signed in to change notification settings - Fork 0
Components
Index of every component in the library. Each one is created via a static factory on org.triggersstudio.moddinglib.client.ui.api.Components (and mirrored as an instance method on ContainerScope for the lambda-based builder syntax).
import static org.triggersstudio.moddinglib.client.ui.api.Components.*;| Family | Components | Page |
|---|---|---|
| Layout |
Row, Column, VScroll, HScroll
|
Layout |
| Text & Buttons |
Text, Button, Image
|
Text and Buttons |
| Inputs |
TextField, TextArea, SliderInt, SliderDouble, SliderFloat, SliderLong, SliderShort, ColorPicker, Calendar
|
Inputs |
| Lists & Selection |
SelectList, ComboBox, Pagination
|
Lists and Selection |
| Feedback |
ProgressBar, Spinner, Skeleton, Tooltip, Toast
|
Feedback |
| Containers |
Accordion, AccordionSingle, Dynamic
|
Containers |
| Charts |
LineChart, BarChart, PieChart
|
Charts |
| Media |
PlayerRender, LocalPlayer
|
Media |
| Animation wrappers |
Animated, FadeIn, FadeOut, SlideIn
|
Animations |
Every container factory has two flavours:
// Vararg form — convenient when the children are statically known.
Column(
Text("a"),
Text("b"),
Text("c")
);
// Builder lambda — for loops, conditions, and dynamic children.
Column(scope -> {
for (var item : items) {
scope.Text(item.name);
}
if (showFooter) scope.Button("close");
});Both produce identical trees. Inside the lambda, scope exposes the same factory methods as Components (scope.Text(...), scope.Button(...), scope.Row(...), etc.).
Every factory has overloads with and without an explicit Style:
Text("hi"); // Style.DEFAULT
Text("hi", Style.fontSize(20).build());
Column(child1, child2); // Style.DEFAULT
Column(Style.padding(8).build(), child1, child2);When a factory takes both a Style and children, the style comes first so the vararg children can flow at the end.
Wherever it matters, factories provide a Supplier<T> overload alongside the plain-value one:
Text("hello"); // static
Text(() -> "now: " + counter.get()); // reactive — re-read every frame
ProgressBar(stateDouble, 0, 100); // bidirectional via State<Double>
ProgressBar(() -> mod.getProgress(), 0, 100); // read-only via DoubleSupplierThe reactive variants don't subscribe to anything — the supplier is just polled on every render frame. Pair with state.map(...) or any Supplier you control.