Add font awesome in EJ2 JavaScript 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.


//Initialize Toolbar component

var toolbar = new ej.navigations.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>' }

//Render initialized Toolbar component
<!DOCTYPE html><html lang="en"><head>
    <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="" type="text/javascript"></script>
<script src="" type ="text/javascript"></script>

    <div id="container">
        <div id="element"></div>
        <div id="result"></div>

var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>

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;