Skip to content

sysadminsmedia/BlazorIconify

Repository files navigation

SysAdminsMedia.BlazorIconify

BlazorIconify is a Blazor component library for Iconify, a unified icon framework that provides a consistent icon experience across all platforms. BlazorIconify is a wrapper around the Iconify API that allows you to easily add icons to your Blazor applications.

Installation

You can install BlazorIconify via NuGet. Run the following command in the Package Manager Console:

Install-Package SysAdminsMedia.BlazorIconify

or via the .NET Core CLI:

dotnet add package SysAdminsMedia.BlazorIconify

Usage

First, you need to add the following line to your _Imports.razor file:

@using SysAdminsMedia.BlazorIconify

Add the following to program.cs:

builder.Services.AddBlazorIconify();

Then, you can use the Iconify component in your Blazor components like this:

<Iconify Icon="mdi:home" />

You can also adjust the color and other properties of the icon:

<Iconify Icon="mdi:home" Color="red" Class="my-custom-class" Style="align-content: center;" />

Configuration Options

You can change the configuration to use a custom Iconify API endpoint, set a default icon color, or set a different error icon. You simply need to set up the appsettings.json file like this:

{
  "Iconify": {
    "ApiEndpoint": "https://custom-iconify-api-endpoint.com",
    "DefaultColor": "blue",
    "ErrorIcon": "mdi:alert"
  }
}

Releases

No releases published

Packages

No packages published