Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

PanelMenu item style not applied #19576

Description

@gianluca-moro

Describe the bug

The PanelMenu MenuItem has a style property for "Inline style of the menuitem". But, specifying styles using that property does not apply the styles.

E.g.,

this.items = [
  {
    label: 'Files',
    icon: 'pi pi-file',
    items: [
      {
        label: 'Documents',
        icon: 'pi pi-file',
        style: { color: 'red !important' },
      }
      // ...
    ]
  }
]

The Documents is not red:

Image

Do I need to specify it differently. If so, how?

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/seknqoe4?file=src%2Fapp%2Fpanelmenu-basic-demo.ts

Environment

PrimeNG 21.1.6
Angular 21

Angular version

21.1.0

PrimeNG version

v21

Node version

No response

Browser(s)

Firefox, Chrome

Steps to reproduce the behavior

  1. Go to https://stackblitz.com/edit/seknqoe4?file=src%2Fapp%2Fpanelmenu-basic-demo.ts
  2. You can see that the Documents menu item is not red, even though it has style: {color: 'red !important'} applied

Expected behavior

The MenuItem styles should be applied

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugIssue contains a bug related to a specific component. Something about the component is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions