Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 1.54 KB

GEmojiSharp.AspNetCore.md

File metadata and controls

61 lines (39 loc) · 1.54 KB

GEmojiSharp.AspNetCore 📦

Build status CodeFactor

GitHub Emoji for ASP.NET Core

The package includes:

  • TagHelpers
  • HtmlHelpers

TagHelpers

Update the _ViewImports.cshtml file, to enable tag helpers in all Razor views:

@addTagHelper *, GEmojiSharp.AspNetCore

Use the <emoji> tag or emoji attribute to render emojis:

<span emoji=":tada:"></span>
<emoji>:tada: initial commit</emoji>

Do you want to use emoji anywhere, on any tag, in the body? Then you can use the BodyTagHelperComponent.

Registration via services container:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRazorPages();
builder.Services.AddTransient<ITagHelperComponent, BodyTagHelperComponent>();

Use any tag to render emojis:

<h1>Hello, :earth_africa:</h1>

HtmlHelpers

Update the _ViewImports.cshtml file, to enable HTML helpers in all Razor views:

@using GEmojiSharp.AspNetCore

Use the Emoji extension methods to render emojis:

@Html.Emoji(":tada: initial commit")
@Html.Emoji(x => x.Text)

Would you like to know more? 🤔

Further documentation is available at https://github.com/hlaueriksson/GEmojiSharp