Label Overview

The Label enables you to associate the label HTML element with the TextBox.

Basic Usage

To associate a TextBox TagHelper with a Label, set the label property by providing a string or a function. The string and the function parameters are setting the inner HTML of the label.

Initializing the Label for the TextBox

The Label exposes a content property that sets the inner HTML of the label.

The following example demonstrates how to create a Label content from a string.

<kendo-textbox name="FirstName">
    <textbox-label content="First Name" />
</kendo-textbox>

The following example demonstrates how to create a Label content from a function.

<kendo-textbox name="FirstName">
    <textbox-label content-handler="labelContentHandler" />
</kendo-textbox>
<script>
    function labelContentHandler() {
        return "First Name"
    }
</script>

Floating Label

The Floating Label enables you to provide a floating label functionality to the TextBox.

The following example demonstrates how to set a Floating Label for a TextBox TagHelper.

<kendo-textbox name="FirstName">
    <textbox-label content="First Name" floating="true" />
</kendo-textbox

If set to true, the component will be wrapped in a container that will allow the floating label functionality.

Important: The value client-side method does not trigger the focusout event of the input. This could affect the floating label functionality. You can overcome this behavior by manually invoking the refresh method of the Floating Label: $("#textbox").data("kendoTextBox").floatingLabel.refresh();

See Also

In this article
Not finding the help you need? Improve this article