Mirage 3.1.1 - How to add Badge in sidebar menuitem

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
andersonneto
Posts: 14
Joined: 05 Sep 2017, 05:20

16 Mar 2022, 18:16

I'm trying to add, but it doesn't work:

Code: Select all

<p:badge value="2">
            <p:menuitem id="om_" value="Requests" icon="fas fa-fw fa-user-lock" outcome="/aut/requests"/>
</p:badge>
Mirage 3.1.1
Primefaces 11

User avatar
w00f
Posts: 307
Joined: 27 Apr 2016, 13:27
Contact:

14 Apr 2022, 15:02

Hi,

Sorry for the delayed response! Please try;

Code: Select all

<span class="menuitem-badge">1</span>

Code: Select all

.menuitem-badge {

position: absolute;
right: 2.5em;
display: inline-block;
width: 18px;
height: 18px;
text-align: center;
background-color: #E91E63;
color: #ffffff;
font-size: 14px;
font-weight: 700;
line-height: 18px;
border-radius: 50%;
}
Best regards,

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

19 Apr 2022, 07:11

Thanks, @woof ;) Also, you can use badge attribute of p:menuitem.

Code: Select all

<p:menuitem badge="1" ..../>
And CSS above;

Code: Select all

<style>
    .menuitem-badge {
        position: absolute;
        right: 2.5em;
        display: inline-block;
        width: 18px;
        height: 18px;
        text-align: center;
        background-color: #E91E63;
        color: #ffffff;
        font-size: 14px;
        font-weight: 700;
        line-height: 18px;
        border-radius: 50%;
    }
</style>

Post Reply

Return to “Mirage - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests