All Components

ToolBar Overview

The Kendo UI ToolBar represents a graphical element for holding button elements and enables the user to easily structure and access them.

Basic Usage

The following example demonstrates the ToolBar in action.

@Component({
    selector: 'my-app',
    template: `
        <kendo-toolbar>
            <kendo-toolbar-button [text]="'Button'"></kendo-toolbar-button>
            <kendo-toolbar-button [text]="'Toggle'" [toggleable]="true"></kendo-toolbar-button>
            <kendo-toolbar-splitbutton
                [text]="'Split Button'"
                [data]="splitButtonData">
            </kendo-toolbar-splitbutton>
            <kendo-toolbar-dropdownbutton
                [text]="'DropDownButton'"
                [data]="dropdownButtonData">
            </kendo-toolbar-dropdownbutton>
            <kendo-toolbar-buttongroup [selection]="'single'">
                <kendo-toolbar-button [toggleable]="true" [icon]="'align-left'"></kendo-toolbar-button>
                <kendo-toolbar-button [toggleable]="true" [icon]="'align-center'"></kendo-toolbar-button>
                <kendo-toolbar-button [toggleable]="true" [icon]="'align-right'"></kendo-toolbar-button>
                <kendo-toolbar-button [toggleable]="true" [icon]="'align-justify'"></kendo-toolbar-button>
            </kendo-toolbar-buttongroup>
        </kendo-toolbar>
    `
})
class AppComponent {
    public splitButtonData: Array<any> = [{
        text: 'Option 1'
    }, {
        text: 'Option 2',
    }, {
        text: 'Option 3',
    }];

    public dropdownButtonData: Array<any> = [{
        text: 'Option 1'
    }, {
        text: 'Option 2',
    }, {
        text: 'Option 3',
    }];
}

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

Manual Setup

  1. Download and install the package.

    npm install --save @progress/kendo-angular-toolbar
  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 ToolBarModule in your application root module.

    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    
    import { ToolBarModule } from '@progress/kendo-angular-toolbar';
    import { AppComponent } from './app.component';
    
    @NgModule({
       bootstrap:    [AppComponent],
       declarations: [AppComponent],
       imports:      [BrowserModule, BrowserAnimationsModule, ToolBarModule]
    })
    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 ToolBar package requires you to install the following peer dependencies in your application:

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

The following dependencies will be installed automatically:

  • @progress/kendo-angular-buttons
  • @progress/kendo-angular-popup
  • @progress/kendo-angular-resize-sensor

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

Functionality and Features

In this article