Constructor
new Label(textopt)
Label constructor.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text | string | <optional> | Initial text to display in the label. |
Example
<h2>Few ways to create and use Label:</h2>
// 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>");Classes
Members
iconSize :Object|undefined
Returns current size of an icon, or undefined when no icon has been set or icon failed to load.
Type:
- Object |
undefined