Indicators Overview

The Indicators are used to decorate other elements or components, creating a visual indication for current status, on-going process or state change.

Basic Usage

The following example demonstrates all available Indicator components in action.

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

@Component({
    selector: 'my-app',
    template: `
        <div class="example">
            <div class="component">
                <div class="component-name">Badge</div>
                <badge-component></badge-component>
            </div>

            <div class="component">
                <div class="component-name">Loader</div>
                <loader-component></loader-component>
            </div>
        </div>
    `,
    styles: [`
        .component {
            margin-bottom: 40px;
        }
        .component-name {
            margin: 0 0 20px;
        }
        loader-component {
            display: block;
            margin-top: -25px;
        }
    `]
})
export class AppComponent {}

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

@Component({
    selector: 'badge-component',
    template: `
        <div class="wrap">
            <span class="k-icon k-i-email-box mail-icon">
                <kendo-badge>8</kendo-badge>
            </span>

            <kendo-badge-container>
                <kendo-avatar [shape]="'circle'" [imageSrc]="designerAvatar"></kendo-avatar>
                <kendo-badge [size]="'small'" [align]="{ vertical: 'bottom', horizontal: 'end' }" [themeColor]="'success'" [cutoutBorder]="true">
                    <span class="k-icon k-i-check k-badge-icon"></span>
                </kendo-badge>
            </kendo-badge-container>
        </div>
    `,
    styles: [`
        .wrap {
            display: flex;
        }
        .mail-icon {
            position: relative;
            overflow: visible;
            font-size: 32px;
        }
        kendo-badge-container {
            margin-left: 25px;
        }
    `]
})
export class BadgeComponent {
    public designerAvatar = 'https://demos.telerik.com/kendo-ui/content/web/Customers/BERGS.jpg';
}

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

@Component({
    selector: 'loader-component',
    template: `
        <div class="example">
            <div class="wrap">
                <div class="example-item" *ngFor="let loader of loaders">
                    <div class="example-item-title">{{ loader.type | titlecase }}</div>
                    <div class="k-block">
                        <kendo-loader
                            [type]="loader.type"
                            [themeColor]="loader.themeColor"
                            [size]="loader.size"
                        >
                        </kendo-loader>
                    </div>
                </div>
            </div>
        </div>
    `,
    styles: [`
        .wrap {
            display: flex;
            align-items: center;
            margin: 0 -10px;
        }
        .example-item {
            flex: 0 0 33%;
            padding: 10px;
        }
        .example-item-title {
            margin-bottom: 10px;
            font-size: 90%;
            font-style: italic;
        }
        .k-block {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 80px;
        }
    `]
})
export class LoaderComponent {
    public loaders = [
        {
            type: 'pulsing',
            themeColor: 'primary',
            size: 'medium'
        },
        {
            type: 'infinite-spinner',
            themeColor: 'secondary',
            size: 'medium'
        },
        {
            type: 'converging-spinner',
            themeColor: 'info',
            size: 'medium'
        }
    ];
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { LayoutModule } from '@progress/kendo-angular-layout';
import { AppComponent } from './app.component';

import { IndicatorsModule } from '@progress/kendo-angular-indicators';

import { BadgeComponent } from './badge.component';
import { LoaderComponent } from './loader.component';

@NgModule({
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        LayoutModule,
        IndicatorsModule
    ],
    declarations: [ AppComponent, BadgeComponent, LoaderComponent ],
    bootstrap:    [ AppComponent ]
})
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, { preserveWhitespaces: true });

Installation

Either use the quick setup (Angular CLI v6 or later) or manually add the package (Angular CLI v5 or earlier).

Quick Setup with Angular CLI v6 or Later

Angular CLI v6 supports the addition of packages through the ng add command which executes in one step the set of otherwise individually needed commands.

ng add @progress/kendo-angular-indicators

Manual Setup

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 Indicator components at once by using the IndicatorsModule, or
  • Import a specific Indicators component by adding it as an individual NgModule.

  1. Download and install the package.

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

    To get all package components, import the IndicatorsModule in your application root or feature module.

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

    The package also exports the following modules for individual components:

    • BadgeModule
    • LoaderModule

    To reduce the size of your application, import only the modules you need.

    import { NgModule } from '@angular/core';
       import { BrowserModule } from '@angular/platform-browser';
       import { AppComponent } from './app.component';
    
       // Imports the Badge
       import { BadgeModule } from '@progress/kendo-angular-indicators';
    
       // Imports the Loader
       import { LoaderModule } from '@progress/kendo-angular-indicators';
    
       @NgModule({
           bootstrap: [AppComponent],
           declarations: [AppComponent],
           imports: [BrowserModule, BadgeModule, LoaderModule]
       })
       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 section on styling.

Dependencies

The Indicators requires you to install the following peer dependencies in your application:

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

The Indicators package utilizes the Angular animation system, which supports a specific set of browsers.

In this article