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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EightBot.Maui.Badger" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EightBot.Maui.Badger" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="EightBot.Maui.Badger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EightBot.Maui.Badger --version 0.1.2
                    
#r "nuget: EightBot.Maui.Badger, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EightBot.Maui.Badger@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EightBot.Maui.Badger&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=EightBot.Maui.Badger&version=0.1.2
                    
Install as a Cake Tool

<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.

Build and Publish NuGet License: MIT

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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