PhosphorIcons 1.0.1

dotnet add package PhosphorIcons --version 1.0.1
                    
NuGet\Install-Package PhosphorIcons -Version 1.0.1
                    
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="PhosphorIcons" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PhosphorIcons" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="PhosphorIcons" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PhosphorIcons --version 1.0.1
                    
#r "nuget: PhosphorIcons, 1.0.1"
                    
#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.
#:package PhosphorIcons@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PhosphorIcons&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=PhosphorIcons&version=1.0.1
                    
Install as a Cake Tool

Phosphor Icons

A Blazor component wrapper for Phosphor Icons, providing all icon variants as strongly-typed, composable Razor components.

Installation

Add a reference to the PhosphorIcons project or package in your Blazor application.

Then add the namespace to your _Imports.razor:

@using Phosphor.Icons

Usage

Each icon is its own Razor component, named after the Phosphor icon it represents (e.g. PhAcorn, PhArrowLeft). Every icon component accepts a Type parameter of type IconType to select the visual style, as well as any additional HTML attributes which are forwarded directly to the underlying <svg> element.

Icons don't come with a default size, so you are responsible for sizing all of your icons. SVGs expose width and height attributes that accept the same values as style="width: {WIDTH}; height: {HEIGHT}", so opting for width="1em" and height="1em" may be preferred over a style attribute.

Basic Example

<PhAcorn Type="IconType.Regular" />

With Additional SVG Attributes

Because icons support attribute splatting, you can pass any standard HTML/SVG attribute directly to the component:

<PhAcorn Type="IconType.Bold" class="my-icon" width="1em" height="1em" style="color: hotpink;" aria-hidden="true" />

Dynamic Usage

Icons can be rendered dynamically using DynamicComponent — useful for rendering icons from a data-driven list:

<DynamicComponent Type="@iconType" Parameters='new Dictionary<string, object> { ["Type"] = IconType.Regular }' />

All available icon component types can be discovered at runtime via reflection:

Assembly.GetAssembly(typeof(PhAcorn))!
        .GetTypes()
        .Where(t => !t.IsEnum && typeof(IComponent).IsAssignableFrom(t));

Icon Types

The IconType enum controls the visual style of every icon:

Value Description
Regular Standard weight outline style
Bold Heavier stroke weight
Thin Lighter, finer stroke weight
Light Between thin and regular
Duotone Two-tone style with a semi-transparent secondary layer
Fill Fully filled / solid style

Parameters

All icon components share the same parameter surface:

Parameter Type Required Description
Type IconType Yes Selects the icon style variant to render.
(unmatched attributes) IReadOnlyDictionary<string, object?> No Any additional attributes (e.g. class, style, aria-*) are forwarded to the <svg> element.

Preview / Test Project

A preview project is included under Test/ targeting net11.0 and net10.0. It renders every icon in the library in a filterable, colour-configurable grid, allowing you to browse all available icons and styles interactively.

To run it:

dotnet run --project Test/Test.csproj

The preview supports:

  • Filtering icons by name via a search input
  • Switching between all IconType variants via a dropdown
  • Choosing a custom colour applied to the icon grid

Licence

See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 96 6/25/2026
1.0.0 81 6/25/2026