Skip to content

GEmojiSharp

:octocat: GitHub Emoji for C#, dotnet and beyond

Install

$git clone https://github.com/hlaueriksson/GEmojiSharp

Install command taken from the project's README or registry entry. Always review code before running it.

GEmojiSharp :octocat:

GitHub Emoji for C# and .NET:

  • netstandard2.0
  • ASP.NET Core
  • Blazor
  • dotnet tool
  • PowerToys Run plugin
  • PowerToys Command Palette extension
  • MCP Server
🐙 :octopus:
➕ :heavy_plus_sign:
🐈 :cat2:
⩵
❤️ :heart:

Content

Introduction

Using emojis on GitHub is accomplish with emoji aliases enclosed by colons:

:+1: This PR looks great - it's ready to merge! :shipit:

:+1: This PR looks great - it's ready to merge! :shipit:

GEmojiSharp make this possible in C#. The library contains a static array of all valid emoji in GitHub Flavored Markdown. That is the intersection of the emoji.json database and the API with available emojis.

A visual referense of all GitHub Emoji:

GEmojiSharp

GitHub Emoji for C# and .NET 📦

Static methods:

Emoji.Get(":tada:").Raw; // 🎉
Emoji.Get("🎉").Alias(); // :tada:
Emoji.Raw(":tada:"); // 🎉
Emoji.Alias("🎉"); // :tada:
Emoji.Emojify(":tada: initial commit"); // 🎉 initial commit
Emoji.Demojify("🎉 initial commit"); // :tada: initial commit
Emoji.Find("party popper").First().Raw; // 🎉
Emoji.Get("✌️").RawSkinToneVariants(); // ✌🏻, ✌🏼, ✌🏽, ✌🏾, ✌🏿

Extension methods:

":tada:".GetEmoji().Raw; // 🎉
"🎉".GetEmoji().Alias(); // :tada:
":tada:".RawEmoji(); // 🎉
"🎉".EmojiAlias(); // :tada:
":tada: initial commit".Emojify(); // 🎉 initial commit
"🎉 initial commit".Demojify(); // :tada: initial commit
"party popper".FindEmojis().First().Raw; // 🎉

Regular expression pattern to match all emojis:

var text = "Lorem 😂😂 ipsum";

var matches = Regex.Matches(text, Emoji.RegexPattern);
string.Join(string.Empty, matches.Select(x => x.Value)); // 😂😂

Regex.Replace(text, Emoji.RegexPattern, string.Empty); // Lorem  ipsum

GEmojiSharp.AspNetCore

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:


<emoji>:tada: initial commit</emoji>

Standard emoji characters are rendered like this:

<g-emoji class="g-emoji" alias="tada" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f389.png">🎉</g-emoji>

Custom GitHub emojis are rendered as images:

Use CSS to properly position the custom GitHub emojis images:

.emoji {
    background-color: transparent;
    max-width: none;
    vertical-align: text-top;
}

Use the JavaScript from g-emoji-element to support old browsers.

Similar plugs

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts. 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI…

An open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM

AI Agent Assistant & development framework that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative.