formaui-net.Framework.Emojis
1.0.0-preview.27
Prefix Reserved
dotnet add package formaui-net.Framework.Emojis --version 1.0.0-preview.27
NuGet\Install-Package formaui-net.Framework.Emojis -Version 1.0.0-preview.27
<PackageReference Include="formaui-net.Framework.Emojis" Version="1.0.0-preview.27" />
<PackageVersion Include="formaui-net.Framework.Emojis" Version="1.0.0-preview.27" />
<PackageReference Include="formaui-net.Framework.Emojis" />
paket add formaui-net.Framework.Emojis --version 1.0.0-preview.27
#r "nuget: formaui-net.Framework.Emojis, 1.0.0-preview.27"
#:package formaui-net.Framework.Emojis@1.0.0-preview.27
#addin nuget:?package=formaui-net.Framework.Emojis&version=1.0.0-preview.27&prerelease
#tool nuget:?package=formaui-net.Framework.Emojis&version=1.0.0-preview.27&prerelease
Forma.Framework.Emojis
The emoji contracts for Forma: Emoji, the value that names one emoji; IEmojiProvider, which
gives the artwork an emoji is drawn with; and IEmojiCatalog, the emoji a picker browses and
searches. Implement a provider to draw emoji with your own artwork, and a catalog to choose the
emoji FormaEmojiPicker offers.
Install
dotnet add package formaui-net.Framework.Emojis --prerelease
Naming an emoji
An Emoji is one character, however many scalar values it takes: a flag, a skin-toned hand and a
family sequence are each one emoji. A string converts implicitly, and TryCreate checks text
that may hold more or less than one character:
using Forma.Framework.Emojis;
Emoji smile = "😀";
Emoji family = "👨👩👧";
if (Emoji.TryCreate(userInput, out var emoji))
{
// emoji.Sequence holds the scalar values
}
Providing artwork
| Type | What it is |
|---|---|
IEmojiProvider |
Provides artwork for emoji: GetArtwork(Emoji) returns the EmojiArtwork to draw it with. |
EmojiArtwork |
The artwork used to draw an emoji: EmojiArtwork.Unicode, the platform's emoji font; EmojiArtwork.Sprite(symbol, sheet), a symbol in a sprite sheet; or EmojiArtwork.Image(url), a standalone image. |
EmojiSprite |
Sprite artwork: its Symbol and the Sheet it is loaded from. |
EmojiImage |
Image artwork: its Url. |
A provider answers every emoji with artwork, and EmojiArtwork.Unicode hands an emoji to the
platform's font. This one draws each emoji from an image named by its code points:
using System.Globalization;
using Forma.Framework.Emojis;
public sealed class CdnEmojiProvider : IEmojiProvider
{
public EmojiArtwork GetArtwork(Emoji emoji)
{
var codepoints = string.Join("-", emoji.Sequence.EnumerateRunes()
.Select(rune => rune.Value.ToString("x", CultureInfo.InvariantCulture)));
return EmojiArtwork.Image($"https://cdn.example.test/emoji/{codepoints}.svg");
}
}
Register it as the IEmojiProvider on each side that renders emoji, in any order beside
AddFormaServerIntegration() and AddFormaWebAssemblyIntegration(), which register no emoji provider of their own:
builder.Services.AddSingleton<IEmojiProvider, CdnEmojiProvider>();
builder.AddFormaServerIntegration();
Providing a catalog
| Type | What it is |
|---|---|
IEmojiCatalog |
The emoji a host offers: TryFindByGroupId lists a category, TryGetByEmoji finds one emoji's entry, and Find returns the entries whose name or keywords match every whitespace-separated term. |
EmojiInfo |
One emoji in a catalog: its Emoji, English Name, search Keywords and GroupId. |
EmojiGroup |
One category: its Id and its English Title, which is also its localization key. |
NullEmojiCatalog |
The catalog holding no emoji, as NullEmojiCatalog.Instance. |
Each entry's GroupId is one of the categories the picker lists: FormaEmojiPicker.DefaultGroups
holds smileys, people, animals, food, activities, travel, objects, symbols and
flags, and the picker's Groups parameter takes your own.
using System.Diagnostics.CodeAnalysis;
using Forma.Framework.Emojis;
public sealed class TeamEmojiCatalog : IEmojiCatalog
{
private static readonly IReadOnlyList<EmojiInfo> Entries =
[
new() { Emoji = "🚴", Name = "person biking", Keywords = ["bicycle", "cyclist"], GroupId = "activities" },
new() { Emoji = "🏆", Name = "trophy", Keywords = ["prize", "win"], GroupId = "activities" },
];
public bool TryFindByGroupId(string groupId, out IReadOnlyList<EmojiInfo> emojis)
{
emojis = Entries.Where(entry => entry.GroupId == groupId).ToList();
return emojis.Count > 0;
}
public bool TryGetByEmoji(Emoji emoji, [MaybeNullWhen(false)] out EmojiInfo info)
{
info = Entries.FirstOrDefault(entry => entry.Emoji == emoji);
return info is not null;
}
public IReadOnlyList<EmojiInfo> Find(string text)
{
var terms = text.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
return terms.Length == 0
? []
: Entries.Where(entry => terms.All(term => Matches(entry, term))).ToList();
}
private static bool Matches(EmojiInfo entry, string term)
=> entry.Name.Contains(term, StringComparison.OrdinalIgnoreCase)
|| entry.Keywords.Any(keyword => keyword.Contains(term, StringComparison.OrdinalIgnoreCase));
}
builder.Services.AddSingleton<IEmojiCatalog, TeamEmojiCatalog>();
Related packages
formaui-net.Framework.Emojis.Unicodeis the default provider, drawing every emoji with the reader's own emoji font.formaui-net.AddOns.Emojis.Twemojisupplies Twemoji artwork and a catalog.
License
Apache License 2.0, under the repository's LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on formaui-net.Framework.Emojis:
| Package | Downloads |
|---|---|
|
formaui-net.Framework.Emojis.Unicode
The default emoji provider for Forma. |
|
|
formaui-net.Blazor
A Blazor component library for .NET 11: form inputs and pickers, dialogs, popovers and toasts, toolbars and menus, tabs and layout, file pickers, uploaders and viewers, icons, emoji and windows. |
|
|
formaui-net.Blazor.Explorer
FormaExplorer, a file manager for the Forma component library over items and folders the host already holds: a folder tree, an address bar with history and breadcrumbs, thumbnail, details and list views, search, sorting and grouping, selection, drag and drop between folders, upload, and a preview of any item. |
|
|
formaui-net.AddOns.Emojis.Twemoji
The Twemoji artwork and emoji catalog for Forma.Blazor. |
|
|
formaui-net.Blazor.Composer
FormaComposer, a rich text authoring surface for Blazor: an editor with the toolbar, dialogs, views and attachments an article or a page body needs, assembled from plugins the host picks. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.27 | 60 | 12/3/2026 |
| 1.0.0-preview.26 | 73 | 12/3/2026 |
| 1.0.0-preview.25 | 74 | 12/2/2026 |
| 1.0.0-preview.24 | 97 | 12/1/2026 |
| 1.0.0-preview.23 | 131 | 11/30/2026 |
| 1.0.0-preview.22 | 132 | 11/30/2026 |
| 1.0.0-preview.21 | 133 | 11/29/2026 |
| 1.0.0-preview.20 | 131 | 11/26/2026 |
| 1.0.0-preview.19 | 133 | 11/26/2026 |
| 1.0.0-preview.18 | 134 | 11/26/2026 |
| 1.0.0-preview.17 | 118 | 11/26/2026 |
| 1.0.0-preview.16 | 119 | 11/24/2026 |
| 1.0.0-preview.15 | 118 | 11/23/2026 |
| 1.0.0-preview.14 | 115 | 11/23/2026 |
| 1.0.0-preview.13 | 112 | 11/21/2026 |
| 1.0.0-preview.12 | 113 | 11/20/2026 |
| 1.0.0-preview.11 | 111 | 11/18/2026 |
| 1.0.0-preview.10 | 118 | 11/17/2026 |
| 1.0.0-preview.9 | 145 | 11/17/2026 |
| 1.0.0-preview.8 | 123 | 11/17/2026 |
What this release changed is in Forma's changelog: https://github.com/FormaUI/Forma/blob/v1.0.0-preview.27/CHANGELOG.md