The FloatingLabel enables you to provide a floating label functionality to
The FloatingLabel provides the floating label functionality in an
The FloatingLabel component supports both Template and Reactive Forms and can contain Kendo UI for Angular Input components such as
or HTML Input elements with the
kendoTextBox directive applied.
Wrap the component with within a FloatingLabel component. When using the
MaskedTextBox component, set its
maskOnFocus option to
To provide the floating label functionality to regular HTML Input elements, wrap an Input element with the
kendoTextBox directive applied within a FloatingLabel component.
Set the Kendo UI for Angular DateInput, DatePicker, or DateTimePicker
placeholder option to an empty string, and wrap the component within a FloatingLabel.
Place an element from the Kendo UI for Angular DropDowns package within a FloatingLabel.
The floating animation will not work if the initial value of the underlying component is set programmatically and it uses [(value)] binding.
As a workaround you could:
- Use Angular forms by utilizing ngModel or formControl binding
- Focus the component manually after the value is updated
The FloatingLabel relies on handling value and focus change events, and neither is triggered when the value is changed programmatically.
The FloatingLabel component allows toggling a text indicating that a form field is optional via the
optional input property. When it is set to
true a default Optional text will be rendered next to the Label text.
The text is customizable via custom messages or the Angular i18n framework.
Refer to the article on Globalization for further details and runnable demos.