Label
Labels are used to display text.
Playground
[Obsidian] every text component (ex: Notification Title, Descriptions, etc.) supports Rich Text by default!
Usage
You can create a Label by calling the AddLabel method on a Groupbox.
Choose between positional arguments for quick calls or a configuration table for more readability.
Positional Arguments
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text of the label | string | nil |
| 2 | Whether to wrap the text | boolean | true |
| 3 | Index/ID of the label | string | nil |
or
Configuration Table
Prop
Type
Methods
You can use the following methods to interact with the label:
SetText
Sets the text of the label.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Text of the label | string | nil |
SetSize
Sets the size of the label.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Size of the label | number | nil |
SetVisible
Shows or hides the label.
| Arg Idx | Argument Description | Type | Default |
|---|---|---|---|
| 1 | Whether to show the label | boolean | nil |