Emojibase

website·Indexed 33 days ago

https://emojibase.dev/

A collection of lightweight, specification-compliant, and localized emoji JSON datasets, regex patterns, and utility functions. It provides tools for handling emoji shortcodes, emoticons, and Unicode conversions, with support for v12.0 and various locales.

Tokens
9.8K
Snippets
63
Records
86
Agent score
66%

What's inside Emojibase

  1. Overview of Emojibase shortcode presets

    Shortcodes are succinct words surrounded by colons (e.g., :cat:) used to represent emojis. Because shortcodes are community-driven and not officially standardized by Unicode, they vary across platforms. Emojibase provides 'presets'—distinct collections of shortcodes that map to emoji hexcodes—to ensure compatibility across different implementations.
  2. Overview of Emojibase features

    Emojibase is a collection of lightweight, pre-generated, specification-compliant, and localized emoji JSON datasets and regex patterns. It is built directly from official emoji data source files and adheres to Unicode Technical Standard #51 (UTS #51) and Unicode Technical Standard #35 (UTS #35) for localization. It supports the latest Emoji 17, Unicode 17, and CLDR 48 release versions.
  3. Overview of Emojibase emoji datasets

    Emojibase provides a collection of lightweight, pre-generated, and specification-compliant emoji datasets. These include localized JSON datasets and regex patterns. The data is built directly from official emoji source files and adheres to the following standards:

    • Unicode Technical Standard #51 (UTS #51)
    • Unicode Technical Standard #35 (UTS #35) for localization
    • Supports the latest Emoji 17, Unicode 17, and CLDR 48 release versions.
  4. EmojiBase specification compliance and data sources

    EmojiBase provides a specification-compliant emoji solution by deriving its data from official Unicode data files. The service is aligned with Unicode Technical Standard #51 and #35.
  5. Access historical emoji versioning and variation data

    EmojiBase captures and persists historical information for reusability, including Unicode versioning, skin tone variations, gender variations, and multi-person emoji data.
  6. Internationalize emoji integrations with localized datasets

    EmojiBase supports emoji localization across 27 languages to facilitate internationalization of emoji integrations.
  7. Understand Emojibase emoticon support and generation

    Emojibase provides a curated set of western-style emoticons mapped to emojis. To reduce maintenance overhead and file size, Emojibase uses naming guidelines and a permutation generator. This allows a single base emoticon definition per emoji to represent various common variations (e.g., different characters for eyes like : or =, or different mouth styles like ), ], or }). Only western-style emoticons are currently supported.
  8. Import localized emoji datasets

    Localized datasets provide emoji objects with translations from CLDR. You can import the full dataset, a compact version for smaller bundle sizes, or the messages dataset for group/subgroup translations.
    import emojis from 'emojibase-data/<locale>/data.json';
    import compactEmojis from 'emojibase-data/<locale>/compact.json';
    import groupsSubgroups from 'emojibase-data/<locale>/messages.json';
  9. Use the Messages format for translations

    The messages dataset provides translations for emoji groups, subgroups, and skin tones. Each entry contains a key (matching TypeScript type aliases) and the translated message.
    import data from 'emojibase-data/en/messages.json';
    
    /*
    {
      "groups": [{ "key": "smileys-emotion", "message": "smileys & emotion", "order": 0 }],
      "subgroups": [{ "key": "face-smiling", "message": "smiling", "order": 0 }],
      "skinTones": [{ "key": "light", "message": "light skin tone" }]
    }
    */
  10. Install emojibase-data

    The emojibase-data package contains pre-generated JSON datasets for emojis, including localized, versioned, and metadata files.
    yarn add emojibase-data
    # OR
    npm install emojibase-data
  11. Import emoji metadata

    Specialized datasets for unique use cases including group hierarchies, hexcode qualifications, and official Unicode names.
    // Non-localized emoji groups, subgroups, and hierarchy
    import { groups, subgroups, hierarchy } from 'emojibase-data/meta/groups.json';
    
    // Map of hexcodes to qualified status (fully, minimally, unqualified)
    import hexcodes from 'emojibase-data/meta/hexcodes.json';
    
    // Array of all emoji unicode characters
    import unicode from 'emojibase-data/meta/unicode.json';
    
    // Map of hexcodes to official Unicode names
    import unicodeNames from 'emojibase-data/meta/unicode-names.json';
  12. Use experimental Unicode property escape regex

    Experimental regex patterns using Unicode property escapes (e.g., \p{Emoji}) are available in the property directory. These are based on an ECMAScript proposal and should be used with caution.
    import PROPERTY_EMOJI_REGEX from 'emojibase-regex/property';