Skip to content

GaldurLabel

classclient onlysince 0.1.0

com.galdurstudio.galdurui.api.widget.GaldurLabel

Themed line of text. The widget is exactly the size of its text (or of its maximum width, the text being cut with "…"). It takes no click or focus and plays no sound, but is narrated.

Example.java
column.addChild(GaldurLabel.of(Component.literal("Title")));GaldurLabel counter = column.addChild(GaldurLabel.muted(Component.literal("Clicks: 0")));counter.setText(Component.literal("Clicks: 1"));  // also updates the width
public class GaldurLabel extends AbstractWidget
PACKAGEapi.widget
SIDEclient only
EXTENDSAbstractWidget

Constructors 1

GaldurLabel

protected2 overloads
protected GaldurLabel(Component text, IntSupplier color)
protected GaldurLabel(Component text, IntSupplier color, int maxWidth)

PARAMETERS

textComponent—
colorIntSuppliersupplier of the ARGB text colour, called every frame
maxWidthintmaximum width in pixels, the text being cut with "…"; 0 or less for none

Methods 4

of

static2 overloads
public static GaldurLabel of(Component text, int maxWidth)
public static GaldurLabel of(Component text)

PARAMETERS

textComponent—
maxWidthint—

RETURNSGaldurLabel — a label in text, at most maxWidth pixels wide

muted

static2 overloads
public static GaldurLabel muted(Component text, int maxWidth)
public static GaldurLabel muted(Component text)

PARAMETERS

textComponent—
maxWidthint—

RETURNSGaldurLabel — a secondary label in text_muted, at most maxWidth pixels wide

getText

public Component getText()

RETURNSComponent — the text shown

setText

public void setText(Component text)

Changes the text and resizes the widget; re-arrange the layout if the width changed.

PARAMETERS

textComponent—
© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyNot an official Minecraft product. Not approved by or associated with Mojang or Microsoft.