New to Kendo UI for AngularStart a free 30-day trial

LabelComponent

Represents the Kendo UI Label component for Angular.

Use the LabelComponent to associate a label with input elements or components.

html
<kendo-label [for]="input" text="First name">
  <kendo-textbox #input></kendo-textbox>
</kendo-label>

Selector

kendo-label

Export Name

Accessible in templates as #kendoLabelInstance="kendoLabel"

Inputs

NameTypeDefaultDescription

for

any

Associates the label with a component by a template reference or with an HTML element by id.

html
<input #myInput />
<kendo-label [for]="myInput" text="Username"></kendo-label>

labelCssClass

any

Sets the CSS classes for the label element. Accepts values supported by the ngClass directive.

html
<kendo-label text="Address" [labelCssClass]="'custom-label'"></kendo-label>

labelCssStyle

any

Sets the CSS styles for the label element. Accepts values supported by the ngStyle directive.

html
<kendo-label text="Name" [labelCssStyle]="{ color: 'red' }"></kendo-label>

optional

boolean

false

Marks a form field as optional. When enabled, the label displays the Optional text by default. You can customize the text by providing a custom message. (See example).

html
<kendo-label text="Phone" [optional]="true"></kendo-label>

text

string

Sets the text content of the Label. Use this property to describe the input.

html
<kendo-label text="Email"></kendo-label>
In this article
SelectorExport NameInputs
Not finding the help you need?
Contact Support