Plugin.Maui.TabbarBadge 1.0.0

dotnet add package Plugin.Maui.TabbarBadge --version 1.0.0
                    
NuGet\Install-Package Plugin.Maui.TabbarBadge -Version 1.0.0
                    
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="Plugin.Maui.TabbarBadge" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.TabbarBadge" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.TabbarBadge" />
                    
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 Plugin.Maui.TabbarBadge --version 1.0.0
                    
#r "nuget: Plugin.Maui.TabbarBadge, 1.0.0"
                    
#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 Plugin.Maui.TabbarBadge@1.0.0
                    
#: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=Plugin.Maui.TabbarBadge&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.TabbarBadge&version=1.0.0
                    
Install as a Cake Tool

Plugin.Maui.TabbarBadge

A library to add Tabbar Badge to Shell Tabbar Items for Android and iOS using .NET MAUI.

Setup

Add the Plugin.Maui.TabbarBadge Nuget Package to your project.

Initialize the Library in your MauiProgram.cs:

builder
    .UseMauiApp<App>()
    .UseTabbarBadge() // <- Add This Line
    .ConfigureFonts(fonts =>
    {
        fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    })

Next you need to assign the Badge to one of your Tabs, the Tab should be setup in your AppShell.xaml like this:

<Tab Title="Cart"
     Icon="tab_cart.png"
     x:Name="CartTab">
    <ShellContent ContentTemplate="{DataTemplate cart:CartPage}" />
</Tab>

In the AppShell.xaml.cs Constructor assign the Tab:

public AppShell()
{
    InitializeComponent();
    
    this.AssignBadge(CartTab); // <- Add this line
}

From now on if you want to change the badge number you can call:

BadgeCounterService.SetCount(1);

Credits

This library is based on the work done by @Abhayprince.

Check out his original Repoistory and the associated Youtube Video for more information about the process.

License

As the original sample this Library is using the MIT License.

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
1.0.0 156 7/7/2025
1.0.0-pre003 132 7/7/2025