HorusStudio.Maui.MaterialDesignControls 2.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package HorusStudio.Maui.MaterialDesignControls --version 2.0.0
                    
NuGet\Install-Package HorusStudio.Maui.MaterialDesignControls -Version 2.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="HorusStudio.Maui.MaterialDesignControls" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HorusStudio.Maui.MaterialDesignControls" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="HorusStudio.Maui.MaterialDesignControls" />
                    
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 HorusStudio.Maui.MaterialDesignControls --version 2.0.0
                    
#r "nuget: HorusStudio.Maui.MaterialDesignControls, 2.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 HorusStudio.Maui.MaterialDesignControls@2.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=HorusStudio.Maui.MaterialDesignControls&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=HorusStudio.Maui.MaterialDesignControls&version=2.0.0
                    
Install as a Cake Tool

MaterialDesignControls Plugin for .NET MAUI

<p align="center"> <img src="resources/git_banner.png" width="500"> </p>

MaterialDesignControls for .NET MAUI, provides a collection of UI controls that follow Material Design 3 Guidelines.

Content table

Demo

IMAGE ALT TEXT HERE

Platform support

MaterialDesignControls Plugin provides cross-platform controls for:

  • Android
  • iOS
  • macOS
  • Windows (upcoming)

Setup

dotnet add package HorusStudio.Maui.MaterialDesignControls

Getting started

In order to use MaterialDesignControls, you need to register it into your MauiAppBuilder on MauiProgram.cs file:

var builder = MauiApp.CreateBuilder();
builder
    .UseMauiApp<App>()
    .UseMaterialDesignControls(options => 
    {
        ...
    });           

and initialize components after your Application has been initialized on App.xaml.cs:

public App()
{
    InitializeComponent();
    MaterialDesignControls.InitializeComponents();
    ...
}           

To add controls to your views, you need to add this namespace on your XAML:

...
xmlns:material="clr-namespace:HorusStudio.Maui.MaterialDesignControls;assembly=HorusStudio.Maui.MaterialDesignControls"
...


<material:MaterialButton ... />
...

Controls

Coming soon

  • MaterialBottomSheet
  • MaterialCodeEntry
  • MaterialDialog
  • MaterialDoublePicker
  • MaterialSearch

Styles

MaterialDesignControls define several Helpers with default configuration for colors, font sizes, font families, and other global styles to be applied on every control:

Configurations

You can override those defaults following too different approaches, one entirely on C# code, and the other using ResourceDictionaries.

var builder = MauiApp.CreateBuilder();
builder
    .UseMauiApp<App>()
    .UseMaterialDesignControls(options => 
    {
        // Enable library logs for debug purposes
        options.EnableDebug();

        // Get exceptions caught by library so you can track them on your sources or do as you need
        options.OnException((sender, exception) =>
        {
            System.Diagnostics.Debug.WriteLine($"EXCEPTION ON LIBRARY: {sender} - {exception}");
        });

        ...
    });           

If you're using custom fonts on your app, you can register them into MaterialDesignControlsBuilder instead of MauiAppBuilder and they will be automatically registered on your Application either way. Also, you need to indicate MaterialDesignControls library which Font is Regular, Medium and Default one to use.

    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureFonts(fonts =>
        {
            fonts.AddFont("Roboto-Regular.ttf", "RobotoRegular");
            fonts.AddFont("Roboto-Medium.ttf", "RobotoMedium");
            fonts.AddFont("Roboto-Bold.ttf", "RobotoBold");
        }, new("RobotoRegular", "RobotoMedium", "RobotoRegular"));

        ...
    });  

Configuration by code

Themes
    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureThemes(
            lightTheme: new MaterialTheme
            {
                Primary = Colors.Blue,
                OnPrimary = Colors.LightBlue,
                ...
            },
            darkTheme: new MaterialTheme
            {
                Primary = Colors.SkyBlue,
                OnPrimary = Colors.DarkBlue,
                ...
            });

        ...
    });  
Font sizes
    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureFontSize(new MaterialSizeOptions
        {
            BodyMedium = 18,
            LabelLarge = 15,
            ...
        })

        ...
    });  
Font tracking sizes
    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureFontTracking(new MaterialSizeOptions
        {
            BodyMedium = 0.35,
            LabelLarge = 0.2
            ...
        })

        ...
    });  
Icons

MaterialDesignControls use default icons for MaterialPicker, MaterialDatePicker and MaterialTimePicker. It also uses a default icon for Error state on each MaterialInputBase. You can override partially or totally default icons by configuring:

    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureIcons(new MaterialIconOptions
        {
            Picker = "ic_expand.png",
            Error = "ic_error.png",
            DatePicker = "ic_date.png",
            TimePicker = "ic_date.png"
        });

        ...
    });  
String formats

You can, also override default string format(s) for MaterialDatePicker and/or MaterialTimePicker by configuring:

    .UseMaterialDesignControls(options => 
    {
        ...

        options.ConfigureStringFormat(new MaterialFormatOptions
        {
            DateFormat = "dd/MM/yyyy",
            TimeFormat = "t"
        });

        ...
    });  

Using Resources

If you have all your resources (Colors, sizes, etc) on ResourceDictionaries, you can override everything detailed above as well without C# code. Library will look for resources named exactly as properties defined on MaterialDesignControls configuration. Each Helper let you indicate, optionally: ResourceDictionary file containing configurations (will inspect all MergedDictionaries if not provided), prefix for those resources if needed.

    .UseMaterialDesignControls(options => 
    {
        ...
        options.ConfigureThemesFromResources("MyResources.xaml", "MaterialLight", "MaterialDark");
        ...
        options.ConfigureFontSizeFromResources("MyResources.xaml", "MaterialSize");
        ...
        options.ConfigureFontTrackingFromResources("MyResources.xaml", "MaterialTracking");
        ...
        options.ConfigureIconsFromResources("MyResources.xaml");
        ...
        options.ConfigureStringFormatFromResources("MyResources.xaml");
        ...
    });  

Samples

Find more usages and samples on our sample app.

Release notes

Check out our progress here.

Developed by

<a href="http://horus.com.uy"><img src="resources/logo.png" width="200"></a>

Contributions

Contributions are welcome! If you find a bug and/or want a feature added please report it.

If you want to contribute code please file an issue, create a branch, and file a pull request.

License

MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst 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
2.0.1 170 8/29/2025
2.0.0 96 8/15/2025
1.1.0 397 5/14/2025
1.0.0-preview.6 225 4/16/2025
1.0.0-preview.5 123 3/28/2025
1.0.0-preview.4 180 3/12/2025
1.0.0-preview.3 219 3/7/2025
1.0.0-preview.2 194 3/5/2025
1.0.0-preview.1 176 3/5/2025

- Update to .NET 9
- [MaterialSegmentedButton] new control added
- [MaterialViewGroup] new control added to group controls and handle single or multiple selection
- [IValidableView] added for error animations
- [MaterialTopAppBar] Add IconPadding property
- [MaterialFloatingButton] [iOS] Fix tap issue
- Improvements with main thread
- [MaterialNavigationDrawer] Add IconSize property
- [MaterialRating] Add ValueChangedCommand and ValueChanged event
- [MaterialPicker/MaterialDatePicker/MaterialTimePicker] [iOS] Fix HorizontalTextAlignment
- [MaterialInputBase] Don't animate on tap when control is disabled
- [MaterialInputBase] Add AlwaysShowLabel property for Outlined type
- [MaterialInputBase] Add ErrorAnimationType and ErrorAnimatiion properties
- [MaterialCard] Support Transparent or null shadow
- [BREAKING CHANGE] [MaterialChipsGroup] Remove control (replaced with MaterialViewGroup)
- [BREAKING CHANGE] [MaterialRadioButtonsGroup] Remove control (replaced with MaterialViewGroup)
- [BREAKING CHANGE] [MaterialChips] Rename MaterialChip
- [BREAKING CHANGE] [MaterialChipsType] Rename to MaterialChipType
- [BREAKING CHANGE] [MaterialChip] Remove “Unselected” VisualState, “Normal” is used instead
- [BREAKING CHANGE] [MaterialChip] Remove “IconStateOnSelection” property
- [BREAKING CHANGE] [MaterialChip] Add SelectionChangedCommand and SelectionChanged event
- [BREAKING CHANGE] [ITouchable] Rename to ITouchableView
- [BREAKING CHANGE] [MaterialButton/MaterialCard/MaterialCheckbox/MaterialChip/MaterialIconButton/MaterialNavigationDrawer/MaterialRadioButton/MaterialRating/MaterialSwitch/MaterialViewButton] Rename Animation property to TouchAnimationType
- [BREAKING CHANGE] [MaterialButton/MaterialCard/MaterialCheckbox/MaterialChip/MaterialIconButton/MaterialNavigationDrawer/MaterialRadioButton/MaterialRating/MaterialSwitch/MaterialViewButton] Remove AnimationParameter property
- [BREAKING CHANGE] [MaterialButton/MaterialCard/MaterialCheckbox/MaterialChip/MaterialIconButton/MaterialNavigationDrawer/MaterialRadioButton/MaterialRating/MaterialSwitch/MaterialViewButton] Rename CustomAnimation property to TouchAnimation
- [BREAKING CHANGE] [MaterialTopAppBar] Rename IconButtonAnimation property to IconButtonTouchAnimationType
- [BREAKING CHANGE] [MaterialTopAppBar] Remove IconButtonAnimationParameter property
- [BREAKING CHANGE] [MaterialTopAppBar] Rename IconButtonCustomAnimation property to IconButtonTouchAnimation
- [Issue #93] Fix NullReferenceException thrown when applying implicit styles