Getting Started with the Kendo UI for Angular Tooltips
This guide provides the information you need to start using the Kendo UI for Angular Tooltips—it includes instructions about the available installation approaches, the required dependencies, the code for running the project, and links to additional resources.
After the completion of this guide, you will be able to achieve an end result as demonstrated in the following example.
Setting Up Your Angular Project
Before you start with the installation of any Kendo UI for Angular control, ensure that you have a running Angular project. The prerequisites to accomplish the installation of the components are always the same regardless of the Kendo UI for Angular package you want to use, and are fully described in the section on setting up your Angular project.
Installing the Components
You can choose to use either of the following two approaches for installing the Kendo UI for Angular package and the styles you want to apply:
Quick Setup with Angular CLI
The quick setup presents an automatic approach for adding packages with Angular CLI through the ng-add
command. It is suitable for saving time and efforts as ng-add
executes in a single step a set of otherwise individually needed commands.
To add the Kendo UI for Angular Tooltips package, run the following command:
ng add @progress/kendo-angular-tooltip
As a result, the ng-add
command will perform the following actions:
- Add the
@progress/kendo-angular-tooltip
package as a dependency to thepackage.json
file. - Import the
TooltipsModule
in the current application module. - Register the Kendo UI Default theme in the
angular.json
file. - Add all required peer dependencies to the
package.json
file. - Trigger
npm install
to install the theme and all peer packages that are added.
Manual Setup
The manual setup provides greater visibility and better control over the files and references installed in your Angular application. You can install the required peer dependencies and a Kendo UI theme by running separate commands for each step and import the desired component modules in your NgModule
.
-
Install the Tooltips package together with its dependencies by running the following command:
npm install --save @progress/kendo-angular-tooltip @progress/kendo-angular-l10n @progress/kendo-angular-popup @progress/kendo-angular-common @progress/kendo-licensing @progress/kendo-angular-icons
-
If you need all Tooltips components in your application, import all Tooltips at once by using the
TooltipsModule
. Otherwise import the specific components by adding their individual modules.The Tooltips package exports the following individual modules for its components:
Module Component TooltipModule Tooltip PopoverModule Popover Depending on your Angular application, import the Tooltips either into your
NgModule
or standalone component:-
Using Modules
-
To add all Tooltips components, import the
TooltipsModule
in yourNgModule
.import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TooltipsModule } from '@progress/kendo-angular-tooltip'; @NgModule({ bootstrap: [AppComponent], declarations: [AppComponent], imports: [BrowserModule, BrowserAnimationsModule, TooltipsModule] }) export class AppModule { }
-
To add individual Tooltips components, import only the modules you need in your
NgModule
.import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { PopoverModule } from '@progress/kendo-angular-tooltip'; @NgModule({ bootstrap: [AppComponent], declarations: [AppComponent], imports: [BrowserModule, BrowserAnimationsModule, PopoverModule] }) export class AppModule { }
-
-
Using Standalone Components
-
To add all Tooltips components, import
TooltipsModule
in your standalone component.import { Component } from '@angular/core'; import { TooltipsModule } from '@progress/kendo-angular-tooltip'; @Component({ standalone: true, selector: 'my-app', imports: [TooltipsModule], template: ` <div kendoTooltip> <button kendoButton>Show Tooltip</button> </div> ` })
-
To add individual Tooltips components, import only the modules you need in your standalone component.
import { Component } from '@angular/core'; import { PopoverModule } from '@progress/kendo-angular-tooltip'; @Component({ standalone: true, selector: 'my-app', imports: [PopoverModule], template: ` <button kendoPopoverAnchor [popover]="myPopover" kendoButton > Show Popover </button> <kendo-popover #myPopover title="Popover Title" body="Popover Body" > </kendo-popover> ` })
-
-
-
The next step is to style the component by installing one of the available Kendo UI themes—Kendo UI Default, Kendo UI Material, or Kendo UI Bootstrap.
3.1 To start using a theme, install its package through NPM.
-
Default theme
npm install --save @progress/kendo-theme-default
-
Bootstrap theme
npm install --save @progress/kendo-theme-bootstrap
-
Material theme
npm install --save @progress/kendo-theme-material
3.2 After the theme package is installed, reference it in your project. You can include a Kendo UI theme in your project in one of the following ways:
- By using an external (CDN) link.
- By using a precompiled CSS file.
- By compiling the theme from the SCSS source files.
-
Using the Components
-
After successfully installing the Tooltips package and importing the desired modules, add the following code in the
app.component.html
file:<div kendoTooltip> <button kendoButton title="Saves the current document">Save</button> </div>
-
Build and serve the application by running the following command in the root folder.
ng serve
-
Point your browser to http://localhost:4200 to see the Kendo UI for Angular Tooltip on the page.
Activating Your License Key
As of December 2020, using any of the UI components from the Kendo UI for Angular library requires either a commercial license key or an active trial license key. If your application does not contain a Kendo UI license file, activate your license key.
Next Steps
- Default configuration
- Specifying anchor elements
- Defining the position
- Setting closable content
- Setting a content template
- Opening the Tooltip programmatically
- API Reference of the Tooltip
Dependencies
The following table lists the specific functionalities that are provided by each of the Tooltip dependencies as per package:
Package Name | Description |
---|---|
@angular/common | Provides the commonly-needed services, pipes, and directives provided by the Angular team. For more information, refer to the official Angular documentation. |
@angular/core | Contains critical runtime parts of the Angular framework that are needed by every application. For more information, refer to the official Angular documentation. |
@progress/kendo-angular-common | Contains common utilities that are needed by every Kendo UI for Angular component. |
@progress/kendo-angular-icons | Contains the Kendo UI for Angular Icons. |
@progress/kendo-angular-popup | Contains the Kendo UI for Angular Popup component. |
@progress/kendo-licensing | Contains the kendo-ui-license CLI Tool for license management and the validatePackage function and type definitions that are used by licensed packages. |
rxjs | Provides the RxJS library for reactive programming which uses Observables for an easier composition of asynchronous or callback-based code. |