Projektanker.Icons.Avalonia 3.1.4

There is a newer version of this package available.
See the version list below for details.
Install-Package Projektanker.Icons.Avalonia -Version 3.1.4
dotnet add package Projektanker.Icons.Avalonia --version 3.1.4
<PackageReference Include="Projektanker.Icons.Avalonia" Version="3.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Projektanker.Icons.Avalonia --version 3.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Projektanker.Icons.Avalonia, 3.1.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Projektanker.Icons.Avalonia as a Cake Addin
#addin nuget:?package=Projektanker.Icons.Avalonia&version=3.1.4

// Install Projektanker.Icons.Avalonia as a Cake Tool
#tool nuget:?package=Projektanker.Icons.Avalonia&version=3.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


A library to easily display icons in an Avalonia App.



Name Description Version
Projektanker.Icons.Avalonia Core library Nuget
Projektanker.Icons.Avalonia.FontAwesome Font Awesome Free Nuget


A full example is available in the demo directory.

1. Register icon providers on app start up

Use the AppBuilder.AfterSetup method to register a callback. Within this callback register the icon prodider(s). Otherwise the visual designer won't be able to use the registered icon provider(s).

class Program
    // Initialization code. Don't use any Avalonia, third-party APIs or any
    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    // yet and stuff might break.
    public static void Main(string[] args)

    // Avalonia configuration, don't remove; also used by visual designer.
    public static AppBuilder BuildAvaloniaApp()
        return AppBuilder.Configure<App>()
    // Called after setup
    private static void AfterSetupCallback(AppBuilder appBuilder)
        // Register icon provider(s)

2. Add xml namespace

Add xmlns:i="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" to your view.

3. Use the icon

Example: The GitHub icon.

<i class="fab fa-github"></i>


<i:Icon Value="fab fa-github" />


<Button i:Attached.Icon="fab fa-github" />



Implement your own Icon Provider

Just implement the IIconProvider interface:

namespace Projektanker.Icons.Avalonia
    /// <summary>
    /// Represents an icon provider.
    /// </summary>
    public interface IIconProvider
        /// <summary>
        /// Gets the prefix of the <see cref="IIconProvider"/>.
        /// </summary>
        string Prefix { get; }

        /// <summary>
        /// Gets the SVG path of the requested icon using the registered icon providers.
        /// </summary>
        /// <param name="value">The value specifying the icon to return it's path from.</param>
        /// <returns>The path of the icon.</returns>
        /// <exception cref="System.Collections.Generic.KeyNotFoundException">The icon associated
        /// with the specified <paramref name="value"/> does not exists.</exception>
        string GetIconPath(string value);

and register it with the IconProvider:



IIconProvider provider = new MyCustomIconProvider(/* custom ctor arguments */);

The IIconProvider.Prefix property have to be unique within all registered providers. It is used to select the right provider. E.g. FontAwesomeIconProvider's prefix is fa.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Projektanker.Icons.Avalonia:

Package Downloads

A library to easily display FontAwesome icons in an Avalonia App.


A library to easily display Material Design icons in an Avalonia App.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.7.0 1,093 11/20/2021
3.5.0 210 11/12/2021
3.4.1 292 11/8/2021
3.4.0 271 11/8/2021
3.2.0 492 10/17/2021
3.1.4 233 10/14/2021
3.1.2 1,351 8/13/2021
3.1.1 241 8/11/2021
3.1.0 987 3/22/2021
3.1.0-pre 143 3/22/2021
3.0.0 657 10/29/2020
3.0.0-pre 344 10/29/2020
2.0.2 391 8/12/2020
2.0.1 363 7/27/2020
2.0.0 352 7/27/2020
1.0.0 267 7/27/2020