heroicons 1.0.1
dotnet add package heroicons --version 1.0.1
NuGet\Install-Package heroicons -Version 1.0.1
<PackageReference Include="heroicons" Version="1.0.1" />
<PackageVersion Include="heroicons" Version="1.0.1" />
<PackageReference Include="heroicons" />
paket add heroicons --version 1.0.1
#r "nuget: heroicons, 1.0.1"
#:package heroicons@1.0.1
#addin nuget:?package=heroicons&version=1.0.1
#tool nuget:?package=heroicons&version=1.0.1
Heroicons for Blazor
A Blazor component wrapper for Heroicons, the beautiful hand-crafted SVG icons by the makers of Tailwind CSS.
This project is a fork that provides Blazor components for all Heroicons, making them easy to use in Blazor applications. All icons and designs are created by the original Heroicons team at Tailwind Labs.
Installation
Install the package from NuGet:
dotnet add package heroicons
Usage
Basic Usage
Import the namespace in your _Imports.razor:
@using heroicons
Then use the HeroIcon component in your Blazor pages:
<HeroIcon Type="IconType.AcademicCap" Style="IconStyle.Outline" Size="IconSize.Regular" />
Icon Styles
Icons are available in two styles:
- Outline - 24x24 outline icons (only available in Regular size)
- Solid - Available in all sizes (16x16, 20x20, and 24x24)
Icon Sizes
Available sizes:
IconSize.Micro- 16x16 (solid only)IconSize.Mini- 20x20 (solid only)IconSize.Regular- 24x24 (outline and solid)
Examples
<HeroIcon Type="IconType.Bell" Style="IconStyle.Outline" Size="IconSize.Regular" />
<HeroIcon Type="IconType.Heart" Style="IconStyle.Solid" Size="IconSize.Mini" />
<HeroIcon Type="IconType.Star" Style="IconStyle.Solid" Size="IconSize.Micro" class="text-yellow-500" />
<HeroIcon Type="IconType.ArrowRight"
Style="IconStyle.Solid"
Size="IconSize.Regular"
class="text-blue-500 hover:text-blue-700"
@onclick="HandleClick" />
Direct Component Usage
You can also use icon components directly:
@using heroicons.Regular.Outline
<BellIcon class="w-6 h-6 text-gray-500" />
@using heroicons.Mini.Solid
<HeartIcon class="w-5 h-5 text-red-500" />
@using heroicons.Micro.Solid
<StarIcon class="w-4 h-4 text-yellow-500" />
Styling
Icons are preconfigured to be styled by setting the color CSS property, either manually or using utility classes like text-gray-500 in a framework like Tailwind CSS.
<HeroIcon Type="IconType.CheckCircle"
Style="IconStyle.Solid"
Size="IconSize.Regular"
class="text-green-500" />
<HeroIcon Type="IconType.ExclamationTriangle"
Style="IconStyle.Outline"
Size="IconSize.Regular"
style="color: #f59e0b;" />
Available Icons
The IconType enum includes all available icons. Some examples:
IconType.AcademicCapIconType.AdjustmentsHorizontalIconType.AdjustmentsVerticalIconType.ArchiveBoxIconType.ArrowDownIconType.ArrowLeftIconType.ArrowRightIconType.ArrowUpIconType.BellIconType.CalendarIconType.CameraIconType.ChatBubbleLeftIconType.CheckIconType.ChevronDownIconType.ChevronLeftIconType.ChevronRightIconType.ChevronUpIconType.ClockIconType.CloudIconType.CogIconType.CreditCardIconType.DocumentIconType.DownloadIconType.EnvelopeIconType.ExclamationCircleIconType.ExclamationTriangleIconType.EyeIconType.FilterIconType.FireIconType.FolderIconType.GlobeIconType.HeartIconType.HomeIconType.InformationCircleIconType.KeyIconType.LightBulbIconType.LinkIconType.LockClosedIconType.MagnifyingGlassIconType.MapIconType.MenuIconType.MicrophoneIconType.MoonIconType.PaperAirplaneIconType.PaperClipIconType.PencilIconType.PhoneIconType.PhotoIconType.PlusIconType.PrinterIconType.QuestionMarkCircleIconType.SaveIconType.SearchIconType.SettingsIconType.ShareIconType.ShoppingCartIconType.StarIconType.SunIconType.TagIconType.TrashIconType.UserIconType.UserGroupIconType.VideoCameraIconType.WifiIconType.XMark- And many more...
The full list of available icons can be found at heroicons.com.
Requirements
- .NET 10.0 or later
- Blazor WebAssembly or Blazor Server
License
This library is MIT licensed.
Credits
All icon designs are created by the Heroicons team at Tailwind Labs.
This Blazor wrapper is an unofficial port and is not affiliated with Tailwind Labs.
| Product | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Upgraded to .NET 10