.NET MAUI: Use Font Awesome Icons in your project

Maybe you want to use some icons in your project like so:

UI snippet with black background with blue user icon and a sample user name right to it

To do that, you need to do the following steps:

1) Select the Font Awesome icon set you wish to use and download the OTF https://fontawesome.com/download

2) Add the font file to your projects /Resources/Fonts folder

3) Add the font info to your MauiProgram.cs:

fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");

Set the Build Action to „MauiFont“ (right click on the font file -> Build Action)

4) Add a new file „Icons.xaml“ to your projects /Resources/Styles folder, with this content:

<?xml version="1.0" encoding="UTF-8" ?>
<?xaml-comp compile="true" ?>

        <x:String x:Key="user">&#xf007;</x:String>


5) For each icon you want to use, you add one line in this style:

<x:String x:Key="user">&#xf007;</x:String>

Where the „Key“ is the keyword, which you will user later in your xaml view file. Instead of „f007“ you enter the respective unicode identifier, which can be found on the Font Awesome page for every icon.

6) Reference your icon lib in App.xaml:

         <ResourceDictionary Source="Resources/Styles/Icons.xaml" />

7) Now you can use the icons in xaml view file:

<HorizontalStackLayout HorizontalOptions="Center">
                Glyph="{StaticResource user}"
    <Label TextColor="DodgerBlue"
        Suzie Sample