Is there any way to change the font color of the labels in Menubar

UI Components for React
Post Reply
ssaha
Posts: 7
Joined: 04 Nov 2022, 10:06

24 Mar 2023, 10:43

I am using the Menubar component to show multiple options in my UI.
Now is there any way we can set different label color for each menu items ?

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

31 Mar 2023, 13:24

Can you open a gitHub ticket please. It looks like a bug. You should be able to do this but its ignoring the style and class for trying to set the color of an individual menu item.

Code: Select all

          items: [
            {
              label: 'Save',
              icon: 'pi pi-fw pi-calendar-plus',
              className: 'text-green-500',
            },
That should make the menu item "green" but the style is not taking hold.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

gulshan212
Posts: 1
Joined: 29 Dec 2022, 15:47
Location: Haldwani, Uttarakhand (India)
Contact:

31 Mar 2023, 18:12

Hello this is Gulshan Negi
Yes, it is possible to set different label colors for each menu item in the Menubar component. One way to achieve this is by using the style prop on each MenuItem component to apply custom styles.
For example, you can define a CSS class for each label color that you want to use and apply it to the style prop of the corresponding MenuItem component.
Thanks

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

03 Apr 2023, 14:27

Yes but as I stated above that is not working. Its a bug
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests