label Component

Use a label component to display a static, read-only text label for short strings of text, such as titles, descriptions, status messages or headers.

{
  "type": "label",
  "text": "I'm a label"
}

Properties

text
STRING [getter]

The text displayed on the label.

colour
COLOUR | null
null sets the default text colour

The text COLOUR.

font
FONT | null
null sets the default font

The FONT for this label's text.

selectable
BOOL
Default: false

If the text for this label is selectable.

linebreak
ENUM
Default: "truncatetail"

How the text should be truncated or wrapped when reaching the end of the line.

Value Description
"truncatehead" Truncate the start of the text on a single line.
"truncatemiddle" Truncate the middle of the text on a single line.
"truncatetail" Truncate the end of the text on a single line.
"wordwrap" Wrap by word onto mutiple lines.
"charwrap" Wrap by character onto multiple lines.
"clip" Clip the text on a single line.
textalign
ENUM
Default: "natural"

How the text should be aligned.

Value Description
"left" Align the text to the left.
"right" Align the text to the right.
"centre" Centre the text.
"justify" Justify the text.
"natural" Natural alignment based on the text.

Also see Shared Properties.

Examples

A large, bold, selectable purple label

{
  "type": "label",
  "text": "Well, hello there!",
  "colour": "systemPurpleColor",
  "selectable": true,
  "font": {
    "size": "large",
    "weight": "bold"
  }
}