Table of Contents

Namespace Dmnk.Icons.Core

NuGet Version

Completely cross-platform icon definitions. These definitions should work with minimal effort in all common .NET UI frameworks. For now, only Blazor has explicit support, but since all icons must be defined as either SVG or PNG, rendering should not pose any issues in other frameworks.

This library was created specifically to support the use in Blazor WASM, where using resource files is not ideal since they compile all Icons directly into the assembly, increasing bundle size. With code-first definitions, the compiler can strip the unused icons, keeping the bundle size small. There seemed to be no existing library that provides this functionality beyond specific icon packs from specific design systems, so this library was created to allow defining Icons in a generic way (Blazor) ViewModels.

Classes

Icon

Defines an icon to be rendered, including its definition, size, color, and accessible name.

IconDefinition

An icon definition, as in, the technical name and the actual icon data.

PngIconDefinition

Defines an icon that is represented as a PNG. The PNG data is stored as a byte array, which can be used to create an Icon of this definition. Note that the actual size of the PNG data may not match the size of the Icon returned by the size properties, in which case the PNG data will be stretched to fit the requested size.

SvgIconDefinition

Defines an icon that is represented as an SVG. The SVG data is stored as a string, which can be used to create an Icon of this definition. Note that the actual size of the SVG data may not match the size of the Icon returned by the size properties, in which case the SVG data will be stretched to fit the requested size.