Skip to content

Instantly share code, notes, and snippets.

@NaokiStark
Created August 26, 2022 16:08
Show Gist options
  • Save NaokiStark/6cc7299336ef4f476801d4351e5f5dc6 to your computer and use it in GitHub Desktop.
Save NaokiStark/6cc7299336ef4f476801d4351e5f5dc6 to your computer and use it in GitHub Desktop.
Use of twemoji on Svelte, the easiest way
import twemoji from "twemoji"; // npm i twemoji
export const stemoji = function (node, params) {
twemoji.parse(node);
return {
update(params) {
twemoji.parse(node);
},
};
}
/* use:
<script>
import { stemoji } from "./twemoji.js";
</script>
<div use:stemoji>
😍🥲🥳🎮😄😥
</div>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment