We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

custom icon toolbar with font-awesome icon


Is it possible to put custom icon in angular treegrid ? I read some tutorials in the forum but all describe how to replace syncfusion icon by another syncfusion icon.

  public toolbar = ['Add''CollapseAll''ExcelExport''CsvExport''Print',
    { text: 'Tout développer'tooltipText: 'Tout développer'prefixIcon: 'fas fa-expand'id: 'ExpandAllCustom' }

when i try this code, the html source look like this : <span class="e-btn-icon fas fa-expand e-icons e-icon-left"></span>
and class fa-expend is not taking into account


1 Reply

PK Padmavathy Kamalanathan Syncfusion Team September 13, 2019 01:24 PM UTC

Hi Yan, 

Thanks for contacting Syncfusion Forums. 

QUERY: Custom icon toolbar with font awesome icon 
From your query we understand that you need to add font awesome icon to the custom toolbar option. This can be done by adding a class to the prefixIcon property of custom toolbar option and setting icon to that class. 

Please refer the below code snippet, 

In index.html 
  <link rel='nofollow' href="//cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="icon" type="image/x-icon" rel='nofollow' href="favicon.ico"> 

In app.component.ts 
    ngOnInit(): void { 
        this.toolbar= ['ExpandAll', 'CollapseAll',  {text: 'Quick Filter', tooltipText: 'Quick Filter', id: 'refresh', prefixIcon: 'e-test'}]; 

In app.component.css 

.e-treegrid .e-toolbar-item .e-test::before { 
  font: normal normal normal 14px/1 FontAwesome; 
  content: "\f06e"; 

Please refer the below screenshot, 


In this way you can set font awesome icon to custom toolbar. 

Please refer the below sample, 

If you have further queries, please get back to us. 

Padmavathy Kamalanathan 

Live Chat Icon For mobile
Up arrow icon