Skip to content

Devmode and Examples

“Perrier” edited this page May 10, 2026 · 1 revision

Devmode & Examples

The library ships with a client command and a folder full of demo screens. They double as a smoke test for the components and as living documentation: each screen is a self-contained, runnable usage example you can read alongside this wiki.

/demomenu

Registered automatically by UICommands.register(). The command opens a screen on the next client tick (so the command source has finished resolving by the time the screen pops up).

Subcommand Opens
/demomenu ExampleScreens.createTooltipScreen()
/demomenu playerrender ExampleScreens.createPlayerRenderScreen()
/demomenu chart ExampleScreens.createChartScreen()

The base /demomenu opens the tooltip screen because that one's the densest demo of styling and overlay rendering. The other example screens aren't surfaced through subcommands yet — you can open them from your own keybind or command (see below).

ExampleScreens

org.triggersstudio.moddinglib.client.ui.examples.ExampleScreens bundles ~22 demo screens, each returning a fully-built UIScreen.

import org.triggersstudio.moddinglib.client.ui.examples.ExampleScreens;

MinecraftClient.getInstance().setScreen(ExampleScreens.createDemoScreen());

The full list:

Method Showcases
createDemoScreen() Counter — reactive State<Integer> + button increment
createTextFieldScreen() TextField bound to State<String> + state.map(...) derived labels + onSubmit
createSliderScreen() Int / Double sliders bound to state, with derived labels
createGalleryScreen() Image grid with row/column layout
createProgressBarScreen() ProgressBar with multiple value formatters
createAnimationScreen() FadeIn / FadeOut / SlideIn
createCornerRadiusScreen() borderRadius across components
createTextAreaScreen() TextArea with character count + max length + tab stops
createSpringScreen() Spring presets (smooth / snappy / bouncy / strong)
createAnimationAdvancedScreen() Animated builder with combined transforms
createCalendarScreen() Date picker bound to State<LocalDate>
createSelectListScreen() SelectList with custom row renderer
createAccordionScreen() Multi-open and single-open accordions
createScrollableListScreen() VScroll wrapping a long Column
createColorPickerScreen() ColorPicker bound to State<Integer> ARGB
createSkeletonScreen() Skeleton placeholders for loading content
createComboBoxScreen() ComboBox with custom labeler + popover styles
createSpinnerScreen() Spinner sizes + colors + periods
createTooltipScreen() Tooltip on multiple anchor types — opened by /demomenu
createToastScreen() Buttons that fire info / success / warning / error toasts
createPlayerRenderScreen() PlayerRender with mouse-tracked rotation toggle — opened by /demomenu playerrender
createChartScreen() LineChart, BarChart, PieChart with shared options — opened by /demomenu chart

DebugOverlay

A built-in inspector toggled with F3 + K while a UIScreen is open. Renders:

  • The bounding box of every component in the tree.
  • The class name and current size at each node.
  • The list of named states (those created with State.of(initial, "name")) with their live values.

It's how you debug an unexpected layout or verify that a State.set(...) call really did fire. The overlay is always available — you don't need to register or import anything.

Adding a demo of your own

Each ExampleScreens.createXxxScreen() is an isolated UIScreen factory — no global state, no prior setup. Copy any one of them as a starting template, edit, and bind it to your own keybind or command. There's no separate "demo registration" step.

Source: src/client/java/org/triggersstudio/moddinglib/client/ui/examples/ExampleScreens.java.

Clone this wiki locally