All Projects → github → g-emoji-element

github / g-emoji-element

Licence: MIT license
Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to g-emoji-element

Emoji Picker Element
A lightweight emoji picker for the modern web
Stars: ✭ 587 (+424.11%)
Mutual labels:  emoji, web-components, custom-elements
esl
Lightweight and flexible UI component library based on web components technology for creating basic UX modules
Stars: ✭ 53 (-52.68%)
Mutual labels:  web-components, custom-elements
remote-input-element
An input element that sends its value to a server endpoint and renders the response body.
Stars: ✭ 72 (-35.71%)
Mutual labels:  web-components, custom-elements
11ty-web-component-generator
Use the power of 11ty to generate web components (custom elements).
Stars: ✭ 51 (-54.46%)
Mutual labels:  web-components, custom-elements
CalDOM
An agnostic, reactive & minimalist (3kb) JavaScript UI library with direct access to native DOM.
Stars: ✭ 176 (+57.14%)
Mutual labels:  web-components, custom-elements
smart-webcomponents-community
Material & Bootstrap Web Components built with Smart
Stars: ✭ 30 (-73.21%)
Mutual labels:  web-components, custom-elements
symbiote.js
Simple, light and very powerful library to create embedded components for any purpose, with a data flow management included.
Stars: ✭ 40 (-64.29%)
Mutual labels:  web-components, custom-elements
Ajax Form
HTML forms on performance-enhancing drugs
Stars: ✭ 232 (+107.14%)
Mutual labels:  web-components, custom-elements
range-slider-element
🍬 <range-slider> custom element
Stars: ✭ 45 (-59.82%)
Mutual labels:  web-components, custom-elements
file-attachment-element
Attach files via drag and drop or file input.
Stars: ✭ 97 (-13.39%)
Mutual labels:  web-components, custom-elements
element
Fast and simple custom elements.
Stars: ✭ 65 (-41.96%)
Mutual labels:  web-components, custom-elements
web-components
A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
Stars: ✭ 322 (+187.5%)
Mutual labels:  web-components, custom-elements
focus-trap
A lightweight web component that traps focus within a DOM node
Stars: ✭ 44 (-60.71%)
Mutual labels:  web-components, custom-elements
page-title
A Polymer element for easily updating a webpage's title, such as in a SPA.
Stars: ✭ 13 (-88.39%)
Mutual labels:  web-components, custom-elements
Tab Container Element
An accessible tab container element with keyboard support.
Stars: ✭ 238 (+112.5%)
Mutual labels:  web-components, custom-elements
grid-container
A grid for the future, CSS Grid Layout + Web Components (Custom Elements v1 + Shadow DOM v1)
Stars: ✭ 51 (-54.46%)
Mutual labels:  web-components, custom-elements
Elements
Lazy load Angular Elements (or any other web components / custom elements ) with ease!
Stars: ✭ 223 (+99.11%)
Mutual labels:  web-components, custom-elements
Progressive Image Element
⚡️ <progressive-image> custom element
Stars: ✭ 231 (+106.25%)
Mutual labels:  web-components, custom-elements
modulor-html
Missing template engine for Web Components
Stars: ✭ 36 (-67.86%)
Mutual labels:  web-components, custom-elements
lego
🚀 Web-components made lightweight & Future-Proof.
Stars: ✭ 69 (-38.39%)
Mutual labels:  web-components, custom-elements

<g-emoji> element

Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.

Installation

$ npm install @github/g-emoji-element

Usage

import '@github/g-emoji-element'
<g-emoji fallback-src="t-rex.png" alias="T-Rex">🦖</g-emoji>

If a browser supports emoji, nothing happens. If a browser does not support emoji, a fallback image tag is created:

<g-emoji fallback-src="t-rex.png" alias="T-Rex">
  <img class="emoji" alt="T-Rex" height="20" width="20" src="t-rex.png">
</g-emoji>

Skin tones

The tone attribute renders the emoji with a skin tone modifier between 1-5. Use 0 to display the default tone.

<g-emoji tone="0">👋</g-emoji>
<g-emoji tone="1">👋🏻</g-emoji>
<g-emoji tone="2">👋🏼</g-emoji>
<g-emoji tone="3">👋🏽</g-emoji>
<g-emoji tone="4">👋🏾</g-emoji>
<g-emoji tone="5">👋🏿</g-emoji>
> const emoji = document.createElement('g-emoji')
> emoji.textContent = '👋'
> emoji.tone = '5'
> document.body.append(emoji)
> emoji.textContent
"👋🏿"

The tone attribute accepts a space separated list of skin tone modifiers to apply to each base emoji in a sequence. Some platforms will display these sequences as a single glyph while others will render each emoji in the sequence.

<g-emoji tone="4 5">🧑🏾<200d>🤝<200d>🧑🏿</g-emoji>

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].