UIPanelBuilder
The function passed to .with() (for UI extensions) or to createWindow() (for custom windows) receives a UIPanelBuilder used to populate that section or window.
Many methods below take a callback parameter. Its signature is written as (ArgType, ...) => ReturnType, e.g. () => bool takes no arguments and returns a bool; (bool) => void takes a bool and returns nothing. Several layout methods (section, hStack, vStack, vScrollView) share the same callback shape — a BuilderFunc, (UIPanelBuilder) => void, called with a nested builder for the enclosed content.
Layout
Section titled “Layout”spacing float? Gap between elements in pixels padding int | int[4]? = null A single value for uniform padding on all sides, or [left, right, top, bottom] childAlignment string? = null A Unity TextAnchor name, e.g. "MiddleCenter" Configures spacing, padding, and child alignment for the current layout scope (the enclosing section/hStack/vStack/vScrollView). spacing is required (pass null explicitly if you only want to set padding/childAlignment); padding and childAlignment default to null, which leaves that property unchanged. Applies to every element in the scope regardless of when within it this is called.
Inserts a vertical spacer that expands to fill remaining space.
func BuilderFunc Receives a nested UIPanelBuilder for the stack's contents Lays out child elements horizontally.
title string func BuilderFunc = null If given, receives a nested UIPanelBuilder for content that appears under the section header Adds a section header. With func, the section’s contents are laid out vertically.
size float? Size in pixels, or null for a flexible spacer that expands to fill available space Inserts blank space in the current layout.
func BuilderFunc Receives a nested UIPanelBuilder for the scrollable content Lays out child elements vertically inside a scrollable view.
func BuilderFunc Receives a nested UIPanelBuilder for the stack's contents Lays out child elements vertically.
Fields & Controls
Section titled “Fields & Controls”Field-returning methods yield a ConfigurableElement for fluent post-configuration.
label string onClick () => void Called when the button is clicked Adds a button.
options string[] currentIndex int onChanged (int) => void Called with the newly selected index Adds a bare dropdown selector without a label.
label string value string Adds a labeled row displaying a static text value.
label string options string[] currentIndex int onChanged (int) => void Called with the newly selected index Adds a labeled dropdown selector.
label string getValue () => bool Called with no arguments; returns the current value onChanged (bool) => void Called with the new value when the toggle is clicked Adds a labeled toggle (checkbox) field.
label string industryComponent IndustryComponent The industry component whose track location to show, e.g. from ops.getIndustryComponent() Adds a labeled row showing an industry component’s track location. Clicking it jumps the camera there.
getValue () => bool Called with no arguments; returns the current value onChanged (bool) => void Called with the new value when the toggle is clicked Adds a bare toggle (checkbox) without a label.
text string Adds a plain text label.
text string Adds a muted label styled for an empty-state message, centered in the remaining space. It positions itself, so it needs no expandingVerticalSpacer around it.
markup string Text with TextMeshPro rich-text tags, e.g. <b>bold</b> Adds a text label that supports rich-text markup.
text string subtitle string? Adds a panel title with an optional subtitle.
Updates
Section titled “Updates”disposable Disposable A disposable handle, e.g. one returned by properties.observe(...) Registers a disposable to be cleaned up when this panel is next rebuilt or closed.
Deprecated. Use setNeedsRebuild(), or rebuildImmediately() if you need the new content before continuing. Still works the same as rebuildImmediately(), but shows a warning in the in-game message log, once per script.
Rebuilds this panel right away, so the new content exists when the call returns. Each call is a full rebuild; to rebuild in response to something that can happen several times in a row, use setNeedsRebuild().
properties Properties A car or object's key-value property store, e.g. car.properties key string Rebuilds this panel when the given property key changes. The panel rebuilds once, later this frame, so a script that sets several observed keys at once costs one rebuild that sees all of the new values.
Rebuilds this panel once, later this frame, no matter how many times it is called before then. Safe to call from inside the panel’s own build function; the rebuild then happens next frame.
ConfigurableElement
Section titled “ConfigurableElement”Returned by UIPanelBuilder methods like button(), label(), and fieldToggle() for fluent post-configuration:
builder.button("Buy", onClick).disable(true)Every method returns the same element, so calls chain together.
disabled bool Enables or disables interaction with the element.
height float Sets the element’s height in pixels.
title string message string Sets a tooltip shown on hover.
width float Sets the element’s width in pixels.
© 2026 Giraffe Lab LLC. All rights reserved.