Emoji are useful tools for communicating application behavior. I recently finished a project which heavily uses them and realized while building that I wanted to add an option for users of the project to customize the interface to their liking. There are plenty of packages to do this for theme, but I could not find any for emoji skin tone, so I decided to build EmojiTone.
This package is a simple interface for building with tone-changing emojis. You can use this with state management on your end to allow users to set the tone as part of their user settings. You can then store that state on a server, in the browser, or however you like. This package is just here to help you with the long and complicated switch statements! Enjoy 💓.
$ npm install emojitone
# or
$ yarn add emojitone
Using EmojiTone is as simple as importing it and passing in any supported emoji and an accepted tone.
import { et } from 'emojitone'
// Returns 👋🏾
et('👋', 'medium-dark')
The accepted tones are:
dark
medium-dark
medium
medium-light
light
It is a good idea to combine this package with simple state management on your end. I have built a simple example Next.js application which stores the state in the browser's localestorage to show you what this might look like. Here is a link to it running live.
👋 🤚 🖐️ ✋ 🖖 🫱 🫲 🫳 🫴 👌 🤌 🤏 ✌️ 🤞 🫰 🤟 🤘 🤙 👈 👉 👆 🖕 👇 ☝️ 🫵 👍 👎 ✊ 👊 🤛 🤜 👏 🙌 🫶 👐 🤲 🤝 🙏 ✍️ 💅 🤳 💪 🦵 🦶 👂 🦻 👃 👶 🧒 👦 👧 🧑 👨 👩 🧓 👴 👵 🙍 🙍♂️ 🙍♀️ 🙎 🙎♂️ 🙎♀️ 🙅 🙅♂️ 🙅♀️ 🙆 🙆♂️ 🙆♀️ 💁 💁♂️ 💁♀️ 🙋 🙋♂️ 🙋♀️ 🧏 🧏♂️ 🧏♀️ 🙇 🙇♂️ 🙇♀️ 🤦 🤦♂️ 🤦♀️ 🤷 🤷♂️ 🤷♀️ 🧑⚕️ 👨⚕️ 👩⚕️ 🧑🎓 👨🎓 👩🎓 🧑🏫 👨🏫 👩🏫 🧑⚖️ 👨⚖️ 👩⚖️ 🧑🌾 👨🌾 👩🌾 🧑🍳 👨🍳 👩🍳 🧑🔧 👨🔧 👩🔧 🧑🏭 👨🏭 👩🏭 🧑💼 👨💼 👩💼 🧑🔬 👨🔬 👩🔬 🧑💻 👨💻 👩💻 🧑🎤 👨🎤 👩🎤 🧑🎨 👨🎨 👩🎨 🧑