-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: Badges in ion-tabs #29639
Comments
I just use |
I am no longer on the team, but ionic-framework/core/src/components/tab-button/tab-button.ios.scss Lines 16 to 28 in ff214bd
Since the element is slotted, badge's position can be customized through CSS in the light dom. |
e.g.: <ion-tab-button>
Text
<ion-badge></ion-badge>
</ion-tab-button> The styling shared earlier will target the badge and position it absolutely in the container. |
Ionicons are not of a consistent viewbox, so you will need to manually position your badge if you want a specific visual appearance. Ionic Framework tries to closely resemble the visual appearance of the iOS tab bar: https://developer.apple.com/documentation/swiftui/tabview |
I can live with that. |
I think the docs should be updated for any component that has a 'default' slot. I wasn't aware that such a thing existed nor how it works. Maybe I missed that. Probably would be a good idea to update the docs for ion-tabs to cover the use of badges since it is such a common use case and it's not obvious how to do it. I've spoken to other devs who didn't know how it works. Thanks for commenting. |
Prerequisites
Describe the Feature Request
Would be helpful to specify the display of a badge with a numeric count within a particular ion-tab-button
Describe the Use Case
Show the count of new messages for a tab button that navigates to an inbox page.
Describe Preferred Solution
Add the following properties to ion-tab-button
Describe Alternatives
Haven't really discovered anything I like.
Related Code
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: