Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to have badges appear on menu icons #2560

Closed
KevinStirling opened this issue Nov 29, 2018 · 1 comment
Closed

Ability to have badges appear on menu icons #2560

KevinStirling opened this issue Nov 29, 2018 · 1 comment

Comments

@KevinStirling
Copy link

What problem does this feature solve?

Currently the menu does allow you to add a badge to an icon, but it breaks the formatting of the collapsed and expanded view of the menu. It would be nice to be able to show badges in the side menu of an application. An example of the problem :

https://stackblitz.com/edit/badge-in-menu-demo

Screenshots

collapsed view

screen shot 2018-11-29 at 11 43 27 am

expanded view

screen shot 2018-11-29 at 11 43 16 am

What does the proposed API look like?

Being able to wrap the anticon object in the <nz-badge [nzCount]="5"> tag like so:

<li nz-submenu [(nzOpen)]="openMap.sub1" (nzOpenChange)="openHandler('sub1')">
    <span title>
             <nz-badge [nzCount]="5">
                     <i class="anticon anticon-upload"></i>
              </nz-badge>
              <span>My Data</span>
     </span>
</li>
@churanov
Copy link

churanov commented Jun 6, 2019

<li nz-submenu *ngIf="isAnyItem$ | async">
  <span title>
    <i nz-icon nzType="plus" nzTheme="outline"></i>
    <span>New</span>
    <nz-badge [nzCount]="totalEditedItems$ | async"  [nzStyle]="{transform: 'translate(15%, -25%)'}"
            ></nz-badge>
  </span>
</li>

image

image

@wenqi73 wenqi73 closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants