Using Material Icons on menuitem

Post Reply
Dragday
Posts: 4
Joined: 09 Jul 2019, 14:52

11 Jul 2019, 13:04

Hello

I am trying to used material icons on a menuitem but it doesn't work.

I've tried using ui-icon prefix, ui- and with no prefix.
The icon doesn't display and shows a "-" at the end of the menu

Here is the code showing all the cases I tried

Image
Image

merve7
Posts: 493
Joined: 12 Sep 2017, 10:44

19 Jul 2019, 09:43

Hi,
AppMenu component uses directly material-icons class. That's mean, you need to use material icons with original names, not ui-icon or another prefix. For example;

Code: Select all

{label: 'Sample Page', icon: 'desktop_mac', routerLink: ['/sample']},
{label: 'Forms', icon: 'insert_chart', routerLink: ['/forms']},
{label: 'Data', icon: 'show_chart', routerLink: ['/data']},
{label: 'Panels', icon: 'pie_chart', routerLink: ['/panels']},
{label: 'Overlays', icon: 'help', routerLink: ['/overlays']},
Also, you can see icon example (all icons in model variable) in app.menu.component.ts file.

Dragday
Posts: 4
Joined: 09 Jul 2019, 14:52

08 Aug 2019, 15:19

Thank you

Post Reply

Return to “Sapphire - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest