Skip to content

marianmeres/emoji-fns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@marianmeres/emoji-fns

Twemoji and Openmoji emoji svgs wrapped as functions with customization arguments returning svg string. Each icon function lives in a separate file and is typed. Note that only default skin-tone is provided.

It's worth emphasizing, that all credit (and copyright) belongs to:

Thanks for the amazing work.

Install

npm i @marianmeres/emoji-fns

Usage

Twemoji are prefixed with twemoji and Openmoji with openmoji.

Signature for all functions is:

prefixEmojiName(cls?: string, size?: number, style?: string): string;

Where emoji names are build from CLDR Short Name data from https://unicode.org/emoji/charts/full-emoji-list.html

So the actual usage example may look like:

import { twemojiAlarmClock } from "@marianmeres/emoji-fns";

// all arguments are optional and size defaults to original (twemoji 36, openmoji 72)
const svg = twemojiAlarmClock('inline-block', 32, "margin: 10px;");

// svg now contains:
// <svg class='inline-block' width="32" height="32" style="margin: 10px;" ... >...</svg>

All functions are typed, so your IDE intellisense should work.

Related

About

"Twemoji" and "Openmoji" emoji svgs wrapped as functions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published