MenuItem: Set icon from asset

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
ruhulrahat
Posts: 1
Joined: 09 Nov 2020, 12:26

22 Nov 2020, 07:29

I am trying to set MenuItem icon from asset folder like this (in Ultima):

Code: Select all

this.model = [
			{
				label: 'Dashboard',
				icon: 'dashboard-icon',
				routerLink: ['dashboard']
			}
                    ]
in .scss file:

Code: Select all

.dashboard-icon {
	background-image: url("./assets/icons/dashboard.svg");
}
But the icon is not showing. Is there anything wrong here, or what is the correct way to show icon for menu?

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

23 Nov 2020, 11:22

Thanks a lot for the sample code! @merve Could you please check this issue?

Best Regards,

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

23 Nov 2020, 14:21

Hi,
Could you try to add width, height, and size like the below code?

Code: Select all

body {
    .dashboard-icon {
        width: 20px;
        height: 20px;    
        background-size: 20px;
        background-image: url("../../layout/images/avatar1.png");
    }
}
Image

Best Regards,

Post Reply

Return to “Ultima - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests