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

Adornments

You can enhance the visual and functional aspects of the MaskedTextBox component by using custom adornments in the form of prefixes and suffixes. Decorating the component allows you to make it more user-friendly and engaging.

Prefix Adornments

The MaskedTextBox allows you to add custom items as prefix adornments by using the KendoPrefixTemplate directive.

Change Theme
Theme
Loading ...

Suffix Adornments

The MaskedTextBox allows you to add custom items as suffix adornments by using the KendoSuffixTemplate directive.

Change Theme
Theme
Loading ...

Separator

To visually separate the specified adornments, set the showSeparator property of the KendoPrefixTemplate and KendoSuffixTemplate directives to true. To separate multiple adornment items, you can add a Separator component.

Change Theme
Theme
Loading ...

Disabling Adornments

By default, both the prefix and suffix adornments are treated as a constituent part of the MaskedTextBox. When you set the disabled property of the MaskedTextBox to true, you also automatically apply the disabled styling to the elements inside the adornments. This ensures that the adornments visually align with the disabled state of the MaskedTextBox. Specifically, the custom prefix and suffix elements will have their pointer-events set to none and their opacity adjusted to match the disabled appearance of the component.

To override the default behavior and ensure that the adornments are interactive, please check out the Enabling Adornments in a Disabled Inputs Component Knowledge Base article.

The following example demonstrates how to visually disable the MaskedTextBox adornments by setting the disabled property of the component.

Change Theme
Theme
Loading ...

Programmatically Disabling Adornments

The KendoPrefixTemplate and KendoSuffixTemplate directives grant you full control over the elements that will be displayed as adornments for the MaskedTextBox. This means that you can programmatically control the disabled state based on the specific element that you are rendering.

The following example demonstrates how to set the disabled property of the adornments when you disable the MaskedTextBox.

Change Theme
Theme
Loading ...

Integration with FloatingLabel

To use the FloatingLabel component with a KendoPrefixTemplate, utilize its labelCssClass or labelCssStyle properties.

The following example demonstrates how to offset the FloatingLabel when using adornments.

Change Theme
Theme
Loading ...