All Components

Inputs Overview

The Inputs are fields which allow for an input of data, based on a specific and predefined format.

Basic Usage

The following example demonstrates the MaskedTextBox, NumericTextBox, Slider, Switch, and TextBox components in action.

import { Component } from '@angular/core';

@Component({
    selector: 'my-app',
    template: `
    <div class="example-wrapper">
        <div class="row">
            <div class="col-xs-12 col-sm-6 example-col">
                <p>MaskedTextBox</p>
                <kendo-maskedtextbox
                    [(ngModel)]="maskedValue"
                    [mask]="'9-000'"
                ></kendo-maskedtextbox>
            </div>
            <div class="col-xs-12 col-sm-6 example-col">
                <p>NumericTextBox</p>
                <kendo-numerictextbox
                    [(ngModel)] = "numericValue"
                ></kendo-numerictextbox>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-6 example-col">
                <p>Slider (value = {{sliderValue}})</p>
                <kendo-slider
                    [min]="min"
                    [max]="max"
                    [smallStep]="smallStep"
                    [(ngModel)] = "sliderValue"
                ></kendo-slider>
            </div>
            <div class="col-xs-12 col-sm-6 example-col">
                <p>Switch</p>
                <kendo-switch [(ngModel)]="switchValue"></kendo-switch>
            </div>
            <div class="col-xs-12 col-sm-6 example-col">
                <p>TextBox</p>
                <kendo-textbox-container floatingLabel="First name">
                  <input kendoTextBox />
                </kendo-textbox-container>
            </div>
        </div>
    </div>
    `
})

export class AppComponent {
    public maskedValue: string;
    public sliderValue: number = 5;
    public numericValue: number = 5;
    public switchValue: boolean = false;
    public min: number = 0;
    public max: number = 10;
    public smallStep: number = 1;
}
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { InputsModule } from '@progress/kendo-angular-inputs';
import { AppComponent } from './app.component';

@NgModule({
    bootstrap:    [AppComponent],
    declarations: [AppComponent],
    imports:      [BrowserModule, FormsModule, InputsModule]
})
export class AppModule { }

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';

enableProdMode();

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);

Installation

All components that you reference during the installation will be present in the final bundle of your application. To avoid ending up with components you do not actually need, either:

  • Import all Inputs components at once by using the InputsModule, or
  • Import a specific Inputs component by adding it as an individual NgModule.

  1. Download and install the package:

    npm install --save @progress/kendo-angular-inputs @progress/kendo-angular-intl @progress/kendo-angular-l10n @angular/animations
  2. Once installed, import the NgModule of the components you need.

    To get all package components, import the InputsModule in your application root module:

    import { NgModule } from '@angular/core';
       import { BrowserModule } from '@angular/platform-browser';
       import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
       import { InputsModule } from '@progress/kendo-angular-inputs';
       import { AppComponent } from './app.component';
    
       @NgModule({
           bootstrap:    [AppComponent],
           declarations: [AppComponent],
           imports:      [BrowserModule, BrowserAnimationsModule, InputsModule]
       })
       export class AppModule {
       }

    The package also exports the following modules for individual components:

    • MaskedTextBoxModule
    • NumericTextBoxModule
    • SliderModule
    • SwitchModule
    • TextBoxModule

    To reduce the size of your application, include only the ones you need:

    import { NgModule } from '@angular/core';
       import { BrowserModule } from '@angular/platform-browser';
       import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    
       // Imports the MaskedTextBox module
       import { MaskedTextBoxModule } from '@progress/kendo-angular-inputs';
    
       // Imports the NumericTextBox module
       import { NumericTextBoxModule } from '@progress/kendo-angular-inputs';
    
       @NgModule({
           bootstrap:  [AppComponent],
           imports:    [
               BrowserModule, BrowserAnimationsModule,
               MaskedTextBoxModule, NumericTextBoxModule
           ]
       })
       export class AppModule {
       }
  3. You are required to install one of the Kendo UI themes for Angular to style your components. For more information on how to add the styles, refer to the article on getting started.

Dependencies

The Inputs package requires the following peer dependencies that have to be installed by your application:

  • @angular/common
  • @angular/core
  • @angular/forms
  • @progress/kendo-angular-intl
  • @progress/kendo-angular-l10n
  • rxjs

The following dependencies will be installed automatically:

  • @telerik/kendo-draggable
  • @telerik/kendo-inputs-common
In this article