Blazicons 1.2.20

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Blazicons --version 1.2.20
NuGet\Install-Package Blazicons -Version 1.2.20
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazicons" Version="1.2.20" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazicons --version 1.2.20
#r "nuget: Blazicons, 1.2.20"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Blazicons as a Cake Addin
#addin nuget:?package=Blazicons&version=1.2.20

// Install Blazicons as a Cake Tool
#tool nuget:?package=Blazicons&version=1.2.20

Blazicons

Provides support for displaying SVG based icons in Blazor projects.

Check out the Demo Site.

Nuget

Build Status

Overview

Blazicons is a simple library consisting of one Blazor component, the Blazicon. A Blazicon component displays an SVG icon similar to how a font icon would be displayed.

Why Blazicons?

Why not just use font libraries to display icons? Blazicons provides a couple of benefits over using font icon libraries.

The first benefit is resource size. Blazicons is desinged to leverage the SVG versions of the icons from popular icon libraries. Given Blazor's assembly trimming, only the icons used, rather than the entire library of icons are delivered to the client.

With Blazicons, an additional benifit is the ability to leverage intellisense. The various icons available in a given icon library are displayed with Visual Studio's intellisense options.

Getting Started

To get started using Blazicons, just install the Blazicons NuGet package of the desired icon library. The following options are currently among those available.

  • Blazicons.Bootstrap
  • Blazicons.FluentUI
  • Blazicons.FontAwesome
  • Blazicons.GoogleMaterialDesign
  • Blazicons.Ionicons
  • Blazicons.MaterialDesignIcons

Next add the Blazicons reference to the _Imports.razor file in the Blazor project.

@using Blazicons

Ensure that the project styles.css file is referenced in the head tag section of the index.html/_Host.cshtml file.

<link href="My.App.styles.css" rel="stylesheet" />

Finally, add the Blazicon component to your Blazor pages/components.

<Blazicon Svg="MdiIcon.Information"></Blazicon>

Parameters

Each parameter in a Blazor component has a rendering cost. Since it might be desireable to have many Blazicons on a page, maybe even in some sort of repeater control, one of the core principal when creating Blazicons was to limit the number of parameters.

As a result, a Blazicon only has one parameter, Svg. The Svg parameter is a special type of SvgIcon. These SvgIcon types are defined in the specific icon library Blazicon files.

Styling

A Blazicon is designed to be displayed with the size and color determined by current font size and color settings. Therefore, the size and color can easily be changed by adjusting the CSS font-size and color style attributes of the containing element.

<div style="font-size 200%; color: #f00;">
    <Blazicon Svg="Ionicon.ShapesSharp"></Blazicon>
</div>

Styling helper methods also are available on the SvgIcon object.

<Blazicon Svg='Ionicon.ShapesSharp.WithColor("#f00").WithSize("200%")'></Blazicon>
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Blazicons:

Package Downloads
Blazicons.FluentUI

Provides the Fluent UI icon library packaged as Blazicons, SVG icon components for Blazor.

Blazicons.FontAwesome

Provides the Font Awesome icon library packaged as Blazicons, SVG icon components for Blazor.

Blazicons.Bootstrap

Provides the Bootstrap icon library packaged as Blazicons, SVG icon components for Blazor.

Blazicons.Ionicons

Provides the Ionicons icon library packaged as Blazicons, SVG icon components for Blazor.

Blazicons.MaterialDesignIcons

Provides the Material Design Icons icon library packaged as Blazicons, SVG icon components for Blazor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.24-alpha 69 4/11/2024
2.0.23-alpha 62 4/11/2024
2.0.22-alpha 64 4/10/2024
1.2.20 3,642 10/30/2023
1.2.20-beta 89 10/30/2023
1.1.17-beta 155 5/10/2023
1.1.14 3,765 1/24/2023
1.1.14-beta 155 1/24/2023
1.1.12-alpha 140 1/23/2023
1.0.10 763 1/3/2023
1.0.10-beta 162 1/3/2023
1.0.8-alpha 239 1/2/2023
1.0.7-alpha 135 1/2/2023
1.0.6-alpha 135 1/2/2023
0.1.3-alpha 235 12/22/2022