Search results

Add font awesome icons in Angular Toolbar component

18 May 2022 / 2 minutes to read

You can customize the Toolbar component items by using third-party icons other than the icons available in the Syncfusion library. In the following example, font awesome icons are used as toolbar items.

  • Refer to the third-party reference link. Here, the CDN link of font awesome is referred.
Copied to clipboard
<link rel="stylesheet" href="" />

The following sample explains how to use font awesome in the toolbar component.

Copied to clipboard
import { Component, ViewChild } from '@angular/core';
import { ToolbarComponent } from '@syncfusion/ej2-angular-navigations';

selector: 'app-container',
template: `
      <e-item prefixIcon="fa fa-twitter"></e-item>
      <e-item prefixIcon="fa fa-facebook"></e-item>
      <e-item prefixIcon="fa fa-whatsapp"></e-item>
      template='<button class="e-btn e-tbar-btn"><span><i style="font-size: 3em; color: Tomato" class="e-icons fa fa-twitter"></i></span></button>'></e-item>

export class AppComponent {

Copied to clipboard
<!DOCTYPE html>
<html lang="en">

    <title>Essential JS 2 Toolbar</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript Toolbar Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="//" rel="stylesheet" />
    <link href="index.css" rel="stylesheet" />
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>

    <link rel="stylesheet" href="">

    <script src="systemjs.config.js"></script>
        <div id='loader'>LOADING....</div>

We can also use templates for rendering icons based on the requirements.


The class “e-icons” is used for standardizing the appearance of the icons to fit into toolbar items. If you wish to override the appearance of the icons used, you could do this by using the following set of classes

Use the following CSS to set the color of icons.

Copied to clipboard
.e-toolbar .e-icons {
    color: #e3165b !important;

Use the following CSS to set the font size of icons.

Copied to clipboard
.e-toolbar .e-btn .e-icons.e-btn-icon {
    font-size: 14px !important;