Skip to content
Backports native emoji characters to browsers that don't support them by replacing the characters with fallback images.
JavaScript
Branch: master
Clone or download
Latest commit 229c212 on Sep 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Initial commit 7 years ago
test add tests for non emoji supportting platforms 6 years ago
.eslintrc.json turn off flow rule for prettier config 6 years ago
.flowconfig Initial commit 7 years ago
.gitignore Initial commit 7 years ago
.travis.yml Initial commit 7 years ago
LICENSE Initial commit 7 years ago
README.md drop ie11 support 6 years ago
emoji-detection.js
index.d.ts types(ts): fix window declaration type 6 years ago
index.js flow strict 6 years ago
index.js.flow add flow definition file for the element API 6 years ago
package-lock.json 1.0.6 6 years ago
package.json 1.0.6 6 years ago
prettier.config.js Initial commit 7 years ago
rollup.config.js use babel-preset-github 6 years ago

README.md

<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>

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.

You can’t perform that action at this time.