/emoji-selector

A minimal, no library, no framework HTML custom element that lets you pick and search emojis for use

Primary LanguageJavaScript

emoji-selector

A HTML custom element implementing the <emoji-selector> tag.

emoji-selector in action

Setup

Installation

npm i emoji-selector

<script src="node_modules/emoji-selector/emoji-selector.bundle.js"></script>

or if you're bundling

import "emoji-selector";
// or
require("emoji-selector");

Usage

    <emoji-selector></emoji-selector>
    <script>
        let emojiSelector = document.querySelector('emoji-selector');

        // You can assign a function to "emojiSelected"
        // that will will be called every time an emoji is select
        emojiSelector.emojiSelected = (char) => {
            console.log(char);
            emojiSelector.close();
        };
    </script>