Add font awesome in EJ2 TypeScript Toolbar control

2 May 20233 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.
    <link rel="stylesheet" href="" />

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

import { Toolbar } from "@syncfusion/ej2-navigations";
let toolbar: Toolbar = new Toolbar({
  items: [
    { prefixIcon: "fa fa-twitter" },
    { prefixIcon: "fa fa-facebook" },
    { prefixIcon: "fa fa-whatsapp" },
    { template: '<button class="e-btn e-tbar-btn"><span style="font-size: 3em; color: Tomato;"><i class="e-icons fa fa-twitter"></i</span></button>' }
<!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="index.css" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <!-- <link href="" rel="stylesheet" /> -->
    <link rel="stylesheet" href="" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>
<script src="" type ="text/javascript"></script>

    <div id='loader'>LOADING....</div>
    <div id='container'>
        <div id='element'></div>
        <div id='result'></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.

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

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

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