# Label

The Wisej.NET `Label` controls are used to display text or images that cannot be edited by the user. They are used to identify objects on a form—to provide a description of what a certain control will do if clicked, for example, or to display information in response to a run-time event or process in your application. Because the `Label` control cannot receive focus, it can also be used to create access keys for other controls.

{% hint style="info" %}
For a full list of properties, methods and events see the [API documentation.](http://docs.wisej.com/api)
{% endhint %}

## Features

### AutoSize

When the `AutoSize` property is set to `true`, the `Label` control will automatically adjust itself to fit the size of its text content.

![Label control demonstrating AutoSize property](/files/-MgfWA5AzYo3IrrdNmUJ)

{% hint style="info" %}
A `BorderStyle` is applied to the Labels to show the `AutoSize` functionality.
{% endhint %}

### HTML

The `Label` control can be scaled to any level of complexity by utilizing the `AllowHtml` property. This property controls whether the value applied to the `Text` property will be interpreted as HTML.

![Label control showing HTML formatting with gradient text and emojis](/files/-MgfZyDX5c2D73KtiM9Y)

### Mnemonics

Mnemonics can be used to provide shortcuts for form navigation. By pressing `ALT + the Mnemonic key` on a `Label` control, the focus will automatically be applied to the control at the next `TabIndex`. Mnemonic keys are specified with an ampersand (`&`).

![Label control demonstrating mnemonic key functionality](/files/-Mgf__jMtPrZYJYDh-nX)

{% hint style="info" %}
Certain controls come with a `Label` property that allows it to display a label without having to create a separate `Label` control, see the link below.
{% endhint %}

{% content-ref url="/pages/-MIuBO1zCPpT0Jut8LQd" %}
[Labels](/docs/controls/general/labels.md)
{% endcontent-ref %}

## How To

### Customize the Appearance

The `Label` control is fully customizable through the `Font`, `Text`, `AllowHTML`, and `AppearanceKey` properties.

#### Font

Like most other controls in Wisej.NET, the `Label` control has a `Font` property that allows for customization of the size, features, and style of font to use for the control.

![Label using Bangers Google Font](/files/-MgfnFOMgN8zIygqIeAj)

#### AllowHtml

When set to true, the Label's `Text` property will be interpreted as HTML content, allowing for full customization of the control.

![Label with HTML content applied](/files/-MgfmSGQeAs7JKuQmbSm)

#### Appearance Key

The `AppearanceKey` property of the control can be used to give the `Label` a custom look. This can be based off of another control already defined in the theme (i.e. button) or as an entirely new appearance defined in a mixin.

{% code title="MyTextLabel.mixin.theme" %}

```
{
	"appearances":
	{
		"myTextLabel":
		{
			"inherit": "textlabel",
			"states":
			{
				"default":
				{
					"styles":
					{
						"backgroundColor": "blue"
					}
				}
			}
		}
	}
}
```

{% endcode %}

## Advanced

### JavaScript Widget

| Item             | Description                                                                                                         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| Class name       | "wisej.web.Label"                                                                                                   |
| Theme appearance | "textlabel", see [Themes](https://docs.wisej.com/theme-builder/theme-elements/elements).                            |
| Child components | "label" is the text container. See [JavaScript](/docs/concepts/javascript-object-model.md).                         |
| Source code      | [https://github.com/iceteagroup/wisej-js](https://github.com/iceteagroup/wisej-js/blob/master/wisej.web.TextBox.js) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/docs/controls/content/label.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
