Skip to content

htmx

Fluent UI Emoji for htmx — a tiny server handler that serves emoji SVG fragments for htmx to swap in. 3,145 emojis in flat, high-contrast, and modern styles.

Terminal window
pnpm add @fluentui-emoji/htmx

Server (Express, or plain node:http):

import express from 'express';
import {fluentEmojiHandler} from '@fluentui-emoji/htmx';
const app = express();
app.use(fluentEmojiHandler()); // GET /fluentui-emoji/:style/:slug?label=...

Page:

<span hx-get="/fluentui-emoji/flat/rocket" hx-trigger="load"></span>
<span hx-get="/fluentui-emoji/modern/party-popper?label=Party!" hx-trigger="load"></span>

Responses are sent with immutable cache headers. There’s also a direct helper for template engines: await emojiHtml('rocket', 'flat', 'Rocket').