A small, fast, browser-friendly emoji search library built from Unicode codepoints.
npm install @samuelbines/emojisA small, fast, browser-friendly emoji search library built from Unicode codepoints.
- π Keyword + hex search
- π¨ Correct handling of emoji sequences (skin tones, modifiers)
- π Works in browser, Node, and Bun
- π¦ Zero runtime dependencies
- π§ No DOM coupling β bring your own UI
Most emoji libraries are either:
- Huge datasets you donβt need
- UI-opinionated pickers
- Hard to extend or inspect
This library focuses on data + search only:
- You control rendering
- You control UX
- You get predictable results
npm install @samuelbines/emojis
bun add @samuelbines/emojis
``ts
import { search } from '@samuelbines/emojis';
const { items: results } = search('waving hand');
results.forEach((e) => {
console.log(e.icon, e.desc);
});
`
Keyword search
`ts`
search('hand');
search('skin tone');
search('thumbs up');
`ts`
search('1F44B'); // waving hand
search('U+1F3FC'); // medium-light skin tone
`ts`
search('hand', { limit: 20 });
Convert hex β emoji
`ts
import { emojiFromHex } from '@samuelbines/emojis';
emojiFromHex(['1F91A', '1F3FC']); // π€πΌ
`
Convert emoji β hex
`ts
import { hexFromEmoji } from '@sam/emoji-search';
hexFromEmoji('π€πΌ'); // ["1F91A", "1F3FC"]
`
Get emoji by ID
`ts
import { getById } from '@sam/emoji-search';
const emoji = getById(42);
console.log(emoji.icon);
`
EmojiEntry shape
`ts`
type EmojiEntry = {
id: number;
icon: string; // "ππ»"
desc: string; // "waving hand: light skin tone"
keywords: string[];
cps: string[]; // ["1F44B","1F3FB"]
};
Browser example
`html
`
The emoji index is generated at build time from emoji.array.json.
`bash`
bun run build
`bash``
npm run build
This keeps runtime code small and fast.
Design decisions
- No fuzzy matching (simple includes is predictable)
- No DOM (UI belongs to you)
- No auto skin-tone generation (explicit > magic)
- Precomputed search strings for speed
- No external dev dependancies
You need a full emoji picker UI
You need locale-aware emoji names
You want fuzzy / AI-style matching
This library is intentionally simple.