All Components

Popup Overview

The Popup positions a piece of content next to a specific anchor component.

Basic Usage

The following example demonstrates the Popup in action.

@Component({
  selector: 'my-app',
  template: `
      <div class="example-config">
        <button #anchor (click)="onToggle()" class="k-button">{{toggleText}} Popup</button>
      </div>
      <kendo-popup [anchor]="anchor" (anchorViewportLeave)="show = false" *ngIf="show">
          <div class='content'>
              <!-- User-defined content -->
              Popup content.
          </div>
      </kendo-popup>
  `,
  styles: [`
    .content {
      padding: 30px;
      color: #787878;
      background-color: #fcf7f8;
      border: 1px solid rgba(0,0,0,.05);
    }
  `]
})
class AppComponent {
    private toggleText: string = "Hide";
    private show: boolean = true;

    public onToggle(): void {
        this.show = !this.show;
        this.toggleText = this.show ? "Hidе" : "Show";
    }
}

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-popup

Manual Setup

  1. Download and install the package.

    npm install --save @progress/kendo-angular-popup
  2. For Angular 6, install the rxjs-compat package. For more information, refer to the article on upgrading to Angular 6.

    npm install --save rxjs-compat@6

    For Angular 5 or earlier, install RxJS v5.5+.

    npm install --save rxjs@^5.5
  3. Once installed, import the PopupModule in your application root or feature module.

    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    import { PopupModule } from '@progress/kendo-angular-popup';
    import { AppComponent } from './app.component';
    
    @NgModule({
       bootstrap:    [AppComponent],
       declarations: [AppComponent],
       imports:      [BrowserModule, BrowserAnimationsModule, PopupModule]
    })
    export class AppModule {
    }
  4. You are required to install one of the Kendo UI themes for Angular to style your component. For more information on how to add the styles, refer to the section on styling.

Dependencies

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

  • @angular/animations
  • @angular/common
  • @angular/core
  • rxjs

The following dependencies are automatically installed:

  • @progress/kendo-popup-common

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

Functionality and Features

In this article