Skip to content

IowaComputerGurus/aspnetcore.utilities.fontawesometaghelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AspNetCore Font Awesome Tag Helpers

A collection of TagHelpers for ASP.NET Core that make utilizing the FontAwesome library easier to use for developers

Build Status

SonarCloud Analysis

Quality Gate Status Coverage Security Rating Technical Debt

Usage Expecations

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.

Setup - Registering TagHelpers

You must modify your _viewimports.cshtml file by adding

@addTagHelper *, ICG.AspNetCore.Utilities.FontAwesomeTagHelpers

Included Tag Helpers

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

Nullable Type Icon Helpers

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" />