# Label

Class · extends [`Element`](https://api.playcanvas.com/pcui/classes/Element.md) · implements [`IPlaceholder`](https://api.playcanvas.com/pcui/interfaces/IPlaceholder.md), [`IBindable`](https://api.playcanvas.com/pcui/interfaces/IBindable.md)`<string>`

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/components/Label/index.ts#L42

The Label is a simple span element that displays some text.

## Constructors

### constructor

```ts
new Label(args?: Readonly<LabelArgs>)
```

Creates a new Label.

**Parameters**

- `args` (`Readonly<`[`LabelArgs`](https://api.playcanvas.com/pcui/interfaces/LabelArgs.md)`>`, optional, default `{}`): The arguments.

## Accessors

### placeholder

```ts
get placeholder(): string
set placeholder(value: string)
```

Gets the placeholder text of the Label.

### renderChanges

```ts
get renderChanges(): boolean
set renderChanges(value: boolean)
```

Gets whether the Label should flash when its value changes.

### text

```ts
get text(): string
set text(value: string)
```

Gets the text of the Label.

### value

```ts
get value(): string
set value(value: string)
```

Gets the value of the Label. This is an alias for [Label#text](https://api.playcanvas.com/pcui/classes/Label.md#text).

### values

```ts
set values(values: string[])
```

Sets multiple values on the Label. If all values are the same, the Label will display that
value. Otherwise, it will be empty and display a "multiple values" state.

## Inherited from [Element](https://api.playcanvas.com/pcui/classes/Element.md)

- `get alignItems(): string` · `set alignItems(value: string)`
- `get alignSelf(): string` · `set alignSelf(value: string)`
- `get binding(): BindingBase` · `set binding(value: BindingBase)`
- `get class(): DOMTokenList`
- `get dom(): HTMLElement`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `get flexBasis(): string` · `set flexBasis(value: string | number)`
- `get flexDirection(): string` · `set flexDirection(value: string)`
- `get flexGrow(): string` · `set flexGrow(value: string | number)`
- `get flexShrink(): string` · `set flexShrink(value: string | number)`
- `get flexWrap(): string` · `set flexWrap(value: string)`
- `get height(): number` · `set height(value: string | number)`
- `get hidden(): boolean` · `set hidden(value: boolean)`
- `get hiddenToRoot(): boolean`
- `get ignoreParent(): boolean` · `set ignoreParent(value: boolean)`
- `get justifyContent(): string` · `set justifyContent(value: string)`
- `get justifySelf(): string` · `set justifySelf(value: string)`
- `get parent(): Element` · `set parent(value: Element)`
- `get readOnly(): boolean` · `set readOnly(value: boolean)`
- `get style(): CSSStyleDeclaration`
- `get tabIndex(): number` · `set tabIndex(value: number)`
- `get width(): number` · `set width(value: string | number)`
- `destroy(): void`
- `flash(): void`
- `link(observers: Observer | Observer[], paths: string | string[]): void`
- `unlink(): void`
- `static create<Type extends Element>(type: string, args: ElementArgs): Type`
- `static register<Type extends Element>(type: string, cls: Object, defaultArguments?: object): void`
- `static unregister(type: string): void`
- `static readonly EVENT_CLICK: "click" = 'click'`
- `static readonly EVENT_DESTROY: "destroy" = 'destroy'`
- `static readonly EVENT_DISABLE: "disable" = 'disable'`
- `static readonly EVENT_ENABLE: "enable" = 'enable'`
- `static readonly EVENT_HIDE: "hide" = 'hide'`
- `static readonly EVENT_HIDE_TO_ROOT: "hideToRoot" = 'hideToRoot'`
- `static readonly EVENT_HOVER: "hover" = 'hover'`
- `static readonly EVENT_HOVER_END: "hoverend" = 'hoverend'`
- `static readonly EVENT_PARENT: "parent" = 'parent'`
- `static readonly EVENT_READ_ONLY: "readOnly" = 'readOnly'`
- `static readonly EVENT_SHOW: "show" = 'show'`
- `static readonly EVENT_SHOW_TO_ROOT: "showToRoot" = 'showToRoot'`

## Inherited from [VectorInput](https://api.playcanvas.com/pcui/classes/VectorInput.md)

- `get error(): boolean` · `set error(value: boolean)`
