JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4608
  • Score
    100M100P100Q111577F
  • License MIT

An emoji mixin for React

Package Exports

  • react-emoji

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-emoji) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-emoji

Circle CI NPM

An emoji mixin for React

Features

  • Switchble emoji assets (twemoji or Emoji One)
  • Supports emoticons such as :) :(

Install

npm i react-emoji
# or
bower i react-emoji # `window.ReactEmoji` is available

Usage

let App = React.createClass({
  getDefaultProps() {
    return {
      text: "foo bar 💯 :)",
    };
  },

  mixins: [
    ReactEmoji
  ],

  render() {
    return <div>{ this.emojify(this.props.text) }</div>;
  }
});

API

emojify(text, options)

Default options

All options are optional.

useEmoticon true
emojitype "twemoji"
width "20px"
height "20px"
host
path
ext "svg"
tagName "img"

Development

Dependency

$ npm i

Run

$ npm start # => http://0.0.0.0:8080

Test

$ npm run test

License

MIT