Custom Icons in menu item

UI Components for React
Post Reply
Hanland
Posts: 15
Joined: 07 Jan 2018, 14:12

21 Sep 2018, 11:11

Hi, I have a context menu which I want to add a custom icon to, I have defined a solid color icon using css,

.docIcon
{
background: #ee414c;
display:block;
width:16px;
height:16px;
position:relative;
}

and used in

{
label: material.name, icon:'docIcon', command: (e) => {
this.execute(mouth, this.target);
}
}

The problem I have is that I need to create a colored Icon based on a RGB value.

As yet I cannot find a way of passing this RGB value to modify the icon in the menu item entry.

Any suggestions ....

Regards

cagatay.civici
Prime
Posts: 18041
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Sep 2018, 14:21

ContextMenu supports font icons, which type of library do you use for custom icons?

Hanland
Posts: 15
Joined: 07 Jan 2018, 14:12

23 Sep 2018, 13:17

I'm not using a library for these custom icons I wish to have a colored square based on a user defined RGB value. The example I found using CSS is great for static values of RGB but I need to use dynamic values

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest