Ionic-framework: feat: ion-button with ion-badge to indicate notifications

Created on 9 Jul 2019  路  5Comments  路  Source: ionic-team/ionic-framework

Feature Request

Ionic version:
[x] 4.x

Describe the Feature Request
ion-button with slottable ion-badge to indicate notifications.

Describe Preferred Solution
ion-tab-button already has this. From the doc:

<ion-tab-button tab="schedule">
  <ion-icon name="calendar"></ion-icon>
  <ion-label>Schedule</ion-label>
  <ion-badge>6</ion-badge>
</ion-tab-button>

Describe Alternatives
Reference to how this can be done currently:
https://forum.ionicframework.com/t/how-to-add-a-badge-to-a-icon-inside-a-ion-button/70868/3

core feature request

Most helpful comment

Hi thanks for the prompt reply!

Sorry, I must've been ambiguous with my original request. Please refer to the screenshot below.

Screenshot_20190709-155226_Chrome

I was thinking something more like the icon-only navbar button shown at top-right which essentially mirrors what Ionic already has with ion-tab-button shown at bottom-left.

All 5 comments

Thanks for the issue! I put together a code pen on how this can be done with ion-button: https://codepen.io/liamdebeasi/pen/MMZyJq.

Does the example provided in my CodePen work for your use case? Thanks!

Hi thanks for the prompt reply!

Sorry, I must've been ambiguous with my original request. Please refer to the screenshot below.

Screenshot_20190709-155226_Chrome

I was thinking something more like the icon-only navbar button shown at top-right which essentially mirrors what Ionic already has with ion-tab-button shown at bottom-left.

Any progress? Would love to see that.

Nice feature to have

that would be great.
waiting for news... 馃槃

Was this page helpful?
0 / 5 - 0 ratings