0

How to add fontawesome icons to Primeng Panel Menu Module. I tried various ways using CSS, adding it in the items array of Primeng nothing is working. Assigning the icon to the icon value in the items array.

app.component.ts

this.items = [
  {
    label: 'DASHBOARD',
    icon: 'custom-icon',
  },
  {
    label: 'ACCOUNTS',
    icon: 'faUserTag',
    items: [
      {
        label: 'ENTERPRISE ACCOUNTS',
        icon: 'pi pi-fw pi-align-left'
      },
      {
        label: 'USER ACCOUNTS',
        icon: 'pi pi-fw pi-align-right'
      },
    ]
  },
  {
    label: 'DEVICES',
    icon: 'pi pi-fw pi-pencil'
  },
  {
    label: 'LOGS',
    icon: 'pi pi-fw pi-pencil'
  },
  {
    label: 'OTA',
    icon: 'pi pi-fw pi-pencil',
    // routerLink: ['ota']
  },
]

app.component.html

<p-panelMenu id="test" [model]="items" >
  </p-panelMenu>
  • Please check out [this issue](https://github.com/FortAwesome/angular-fontawesome/issues/117) for a similar problem with primeng button component. It seems that using `angular-fontawesome` is not possible with PanelMenu component, but you may be able to use [FA web fonts](https://fontawesome.com/docs/web/dig-deeper/webfont-vs-svg) with primeng or open issue to request support for SVG icons similar to [this](https://github.com/primefaces/primeng/issues/4588). – Yaroslav Admin Sep 01 '22 at 08:37
  • 1
    Thank you checking it out. – Rushabh Gandhi Sep 01 '22 at 16:55

0 Answers0