Getting Started
Create a new maui project
Add
UseMaterialComponents
inMauiProgram.cs
c#using Material.Components.Maui.Extensions; ... public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); ... builder .UseMaterialComponents(); return builder.Build(); } ...
Add Material colors & styles in
App.xaml
xml<?xml version="1.0" encoding="UTF-8" ?> <Application ... xmlns:mds="clr-namespace:Material.Components.Maui.Styles;assembly=Material.Components.Maui"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> ... <ResourceDictionary Source="Resources/Styles/Colors.xaml" /> <ResourceDictionary Source="Resources/Styles/Styles.xaml" /> <mds:MaterialStyles /> <!--or use seedColor <mds:MaterialStyles Dark="DarkBlue" Light="Green" />--> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
Using components in
.xaml
xml<?xml version="1.0" encoding="utf-8" ?> <ContentPage ... xmlns:mdc="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui"> <mdc:Button Text="button" IconKind="Add" /> </ContentPage>