A collection of TagHelpers for ASP.NET Core that make utilizing the FontAwesome library easier to use for developers
These tag helpers are only for markup display, your web project must properly include references to FontAwesome and must abide by all license and other requirements of FontAwesome for the functionality to be utilized here. For more on how to include FontAwesome within your project please reference their documentation.
You must modify your _viewimports.cshtml
file by adding
@addTagHelper *, ICG.AspNetCore.Utilities.FontAwesomeTagHelpers
The following is a short example of the included tag helpers, for full information on the helpers included, please run the "Samples" app, contained within this repository
These helpers are for nullable types and will either show the value of the object, or a font-awesome icon if there is no value. Currently we support the following types.
- bool
- DateTime
- decimal
- int
- string
The idea behind these helpers is that you can reduce code such as this
@if(Model.UpdatedDate.HasValue)
{
@Model.UpdatedDate
}
else
{
<span class="fas fa-minus"></span>
}
Down to this
<date-time-font-awesome-icon Value="@Model.UpdatedDate" />