Plugin.Maui.FitText 1.0.1

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

Plugin.Maui.FitText

image

Plugin.Maui.FitText is a .NET MAUI plugin that provides two drop-in controls — FitTextLabel and FitTextButton — whose text automatically resizes to fit the available space. It uses platform-native font scaling on iOS and Android for optimal performance and appearance.


Features

  • 📏 Auto-resizing Label and Button controls.
  • 🧠 Shared logic for dynamic font size calculation.
  • ⚙️ Native support for Android (AutoSizeTextType.Uniform) and iOS (AdjustsFontSizeToFitWidth).
  • ✅ Simple integration: just call .UseFitText() during startup.

Getting Started

1. Install the NuGet Package

dotnet add package Plugin.Maui.FitText

NuGet

Available on NuGet.

2. Register the Plugin in MauiProgram.cs

public static MauiApp CreateMauiApp()
{
    var builder = MauiApp.CreateBuilder()
        .UseMauiApp<App>()
        .UseFitText(); // <-- Register the FitText handlers here

    return builder.Build();
}

3. Use the Controls

<fittext:FitTextLabel Text="Hello World"
                      MinFontSize="8"
                      MaxFontSize="80"
                      HorizontalOptions="Center"
                      VerticalOptions="Center"
                      BackgroundColor="LightGray"
                      WidthRequest="200"
                      HeightRequest="50" />


<fittext:FitTextButton Text="Tap Me"
                       MinFontSize="10"
                       MaxFontSize="60"
                       BackgroundColor="SlateBlue"
                       TextColor="White"
                       WidthRequest="200"
                       HeightRequest="50" />

In your XAML, don't forget the namespace:

xmlns:fittext="clr-namespace:Plugin.Maui.FitText;assembly=Plugin.Maui.FitText"

Optional Properties

Property Type Description
MinFontSize double The smallest font size allowed when shrinking. Default: 10
MaxFontSize double The starting size and upper bound. Default: 100

Samples

A sample .NET MAUI app is included in the /samples directory, demonstrating how to use FitTextLabel and FitTextButton.


License

MIT © 2025 Ed Giardina

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-maccatalyst18.0 is compatible.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 is compatible.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.1 130 5/20/2025
1.0.0 130 5/19/2025