constructor([text])
Class: Label.
Description:
Label constructor.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
string |
Initial text to display in the label. |
Examples:
Few ways to create and use Label:
// Setting text in constructor
const label1 = new Label("New label text");
// Setting text after instantiation
const label2 = new Label().text("Second label text");
// setting an image icon
const label2 = new Label().icon("images/icon.png");
// setting HTML content to be rendered in the label component
const label2 = new Label("<html><body><h1>Label Header</h1><p>New paragraph</p></body></html>");
