Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-emoji

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-emoji

An emoji mixin for React

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-14.25%
Maintainers
1
Weekly downloads
 
Created
Source

react-emoji

Circle CI NPM

An emoji mixin for React

Features

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

Compatible React Versions

0.13 and 0.14 both can be used <= 0.4.x. However test code depends on React 0.14.

Demo

banyan.github.io/react-emoji

Install

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

Usage

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

  mixins: [
    ReactEmoji
  ],

  render() {
    return (
      <div>
        <span>{ this.emojify(this.props.text) }</span>
        <span>{ ReactEmoji.emojify(this.props.text) }</span> // or can be used no mixin way
      </div>
    );
  }
});

API

emojify(text, options)

Default options

All options are optional.

PropertiesDescriptionDefaultType
useEmoticonUse emoticon or nottrueBoolean
emojiTypetwemoji or emojione are availabletwemojiString
hostCustom host""String
pathCustom path""String
extasset ext. svg or png are availablesvgString
attributesAttributes such as className or onClick{width: '20px', height: '20px'}Object
singleEmojiShow single emoji (either of annotation or emoticon), use this option if input is limited to render single emoji, this is slightly fasterfalseBoolean
strictThrow an error if annotation is not in dict, it's handy if emoji input is not from end userfalseBoolean

Tips

In tandem with react-autolink.

Development

Dependency

$ npm i

Run

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

Test

$ npm test

License

MIT

Keywords

FAQs

Package last updated on 01 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc