Components
Label
The Label Component.
The label component is used to display text on the screen. It supports various text alignment options and can be styled with different colors and shadow effects.
Parameters
text
string required
The text to display in the label.
max-width
int
The maximum width of the label in pixels.
line-height
int
The line height of the text in pixels.
color
red | yellow | blue | green | gray | purple | ...
The color of the text.
shadow
boolean
Whether to apply a shadow effect to the text.
horizontal-alignment
left | right | center
The horizontal alignment of the child components.
vertical-alignment
top | middle | bottom
The vertical alignment of the child components.
Examples
Components.label(Text.literal("Hello, World!"))
.color(0xffffff)
.shadow(true)
.horizontalTextAlignment(HorizontalAlignment.CENTER)
.verticalTextAlignment(VerticalAlignment.CENTER)
<label>
<text>Hello, World!</text>
<color>#ffffff</color>
<shadow>true</shadow>
<horizontal-text-alignment>center</horizontal-text-alignment>
<vertical-text-alignment>center</vertical-text-alignment>
</label>