JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2893
  • Score
    100M100P100Q108815F
  • 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.

Properties Default value Type
useEmoticon true Boolean
emojiType twemoji String
width 20px String
height 20px String
host "" String
path "" String
ext svg String
className img String

Tips

In tandem with react-autolink.

Development

Dependency

$ npm i

Run

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

Test

$ npm test

License

MIT