Blazicons 1.1.17-beta

This is a prerelease version of Blazicons.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazicons --version 1.1.17-beta                
NuGet\Install-Package Blazicons -Version 1.1.17-beta                
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.1.17-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazicons --version 1.1.17-beta                
#r "nuget: Blazicons, 1.1.17-beta"                
#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.1.17-beta&prerelease

// Install Blazicons as a Cake Tool
#tool nuget:?package=Blazicons&version=1.1.17-beta&prerelease                

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 (9)

Showing the top 5 NuGet packages that depend on Blazicons:

Package Downloads
Blazicons.MaterialDesignIcons

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

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.Ionicons

Provides the Ionicons 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.30 605 12/5/2024
2.1.30-beta 72 12/5/2024
2.1.29-alpha 77 12/5/2024
2.0.28 21,467 4/28/2024
2.0.28-beta 103 4/28/2024
2.0.26-alpha 115 4/24/2024
2.0.24-alpha 117 4/11/2024
2.0.23-alpha 116 4/11/2024
2.0.22-alpha 115 4/10/2024
1.2.20 7,042 10/30/2023
1.2.20-beta 128 10/30/2023
1.1.17-beta 190 5/10/2023
1.1.14 4,377 1/24/2023
1.1.14-beta 192 1/24/2023
1.1.12-alpha 176 1/23/2023
1.0.10 904 1/3/2023
1.0.10-beta 201 1/3/2023
1.0.8-alpha 310 1/2/2023
1.0.7-alpha 171 1/2/2023
1.0.6-alpha 173 1/2/2023
0.1.3-alpha 310 12/22/2022