EightBot.Maui.Badger
0.1.2
Prefix Reserved
dotnet add package EightBot.Maui.Badger --version 0.1.2
NuGet\Install-Package EightBot.Maui.Badger -Version 0.1.2
<PackageReference Include="EightBot.Maui.Badger" Version="0.1.2" />
<PackageVersion Include="EightBot.Maui.Badger" Version="0.1.2" />
<PackageReference Include="EightBot.Maui.Badger" />
paket add EightBot.Maui.Badger --version 0.1.2
#r "nuget: EightBot.Maui.Badger, 0.1.2"
#:package EightBot.Maui.Badger@0.1.2
#addin nuget:?package=EightBot.Maui.Badger&version=0.1.2
#tool nuget:?package=EightBot.Maui.Badger&version=0.1.2
<p align="center"> <img src="logo.png" alt="EightBot.Maui.Badger Logo" width="128" height="128"> </p>
EightBot.Maui.Badger
A .NET MAUI library for adding badges to TabbedPage tabs with support for custom colors.
Features
- 🏷️ 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
| Platform | Support |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| MacCatalyst | ❌ |
| Windows | 🚧 |
Installation
Install via NuGet Package Manager:
dotnet add package EightBot.Maui.Badger
Or via the Package Manager Console:
Install-Package EightBot.Maui.Badger
Setup
Add .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();
}
Usage
XAML
<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">
</ContentPage>
<ContentPage Title="Messages"
badger:TabBadge.BadgeText="{Binding UnreadCount}"
badger:TabBadge.BadgeColor="#FF5722">
</ContentPage>
</TabbedPage>
C#
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);
API Reference
Attached Properties
| 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" |
Sample Application
A sample application demonstrating all features is included in the repository under EightBot.Maui.Badger.Sample.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the original Xamarin.Forms Tab Badge library
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-android35.0 is compatible. net9.0-ios18.0 is compatible. net10.0-android was computed. net10.0-ios was computed. |
-
net9.0-android35.0
- Microsoft.Maui.Controls (>= 9.0.120)
-
net9.0-ios18.0
- Microsoft.Maui.Controls (>= 9.0.120)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.2 | 97 | 1/26/2026 |