A .NET MAUI library for adding badges to TabbedPage tabs with support for custom colors.
- 🏷️ Badge Text - Display text or numbers on tab badges
- 🎨 Custom Colors - Customize badge background and text colors
- 📱 Cross-Platform - Supports Android, iOS, and MacCatalyst
| Platform | Support |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| MacCatalyst | ❌ |
| Windows | 🚧 |
Install via NuGet Package Manager:
dotnet add package EightBot.Maui.BadgerOr via the Package Manager Console:
Install-Package EightBot.Maui.BadgerAdd .UseBadger() in your MauiProgram.cs:
using EightBot.Maui.Badger;
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseBadger(); // Add this line
return builder.Build();
}<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badger="clr-namespace:EightBot.Maui.Badger;assembly=EightBot.Maui.Badger">
<ContentPage Title="Home"
badger:TabBadge.BadgeText="5"
badger:TabBadge.BadgeColor="Red"
badger:TabBadge.BadgeTextColor="White">
<!-- Page content -->
</ContentPage>
<ContentPage Title="Messages"
badger:TabBadge.BadgeText="{Binding UnreadCount}"
badger:TabBadge.BadgeColor="#FF5722">
<!-- Page content -->
</ContentPage>
</TabbedPage>using EightBot.Maui.Badger;
// Set badge on a page
TabBadge.SetBadgeText(myPage, "99+");
TabBadge.SetBadgeColor(myPage, Colors.Red);
TabBadge.SetBadgeTextColor(myPage, Colors.White);
// Clear badge
TabBadge.SetBadgeText(myPage, null);| Property | Type | Default | Description |
|---|---|---|---|
BadgeText |
string |
null |
The text to display in the badge |
BadgeColor |
Color |
Colors.Red |
Badge background color |
BadgeTextColor |
Color |
Colors.White |
Badge text color |
AutoHide |
bool |
true |
Auto-hide when text is empty or "0" |
A sample application demonstrating all features is included in the repository under EightBot.Maui.Badger.Sample.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the original Xamarin.Forms Tab Badge library
Contributions are welcome! Please feel free to submit a Pull Request.
