Table of Contents

Class BlazorIconExtensions

Namespace
Dmnk.Icons.Blazor
Assembly
Dmnk.Icons.Blazor.dll

Helpers to convert Icons to Blazor MarkupStrings for rendering in Blazor components.

public static class BlazorIconExtensions
Inheritance
BlazorIconExtensions
Inherited Members

Properties

DefaultColor

Set this globally to change the default color used for icons that don't specify a color. The default is "var(--accent-fill-rest)", which is the default accent color in Fluent UI. You can set this to any valid CSS color value, e.g. "red", "#ff0000", "rgb(255, 0, 0)", etc.

public static string DefaultColor { get; set; }

Property Value

string

Methods

ToMarkup(Icon)

        Convert a generic <xref href="Dmnk.Icons.Core.Icon" data-throw-if-not-resolved="false"></xref> to a Blazor <xref href="Microsoft.AspNetCore.Components.MarkupString" data-throw-if-not-resolved="false"></xref> that can be
        rendered in a Blazor component. The conversion is done based on the type of the icon
        definition, e.g. if it's an SVG icon, a 
<svg>

element will be created, if it's a PNG icon, an

<img>

element will be created, etc. If the icon definition type is not supported, a red error message will be rendered instead (in release mode) or an exception will be thrown (in debug mode).

public static MarkupString ToMarkup(this Icon icon)

Parameters

icon Icon

Returns

MarkupString