2.2.18 • Published 7 years ago

react-emojione2 v2.2.18

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

react-emojione2

A tiny ES6 library to use emojis in React, Emoji-Mart version

Features

  • Compatible with Emoji-Mart library
  • Converts :shortnames:, unicode and ASCII smileys
  • Copy-paste friendly
  • Use it as a library or mixin
  • No dangerouslySetInnerHTML
  • Inline styles
  • Sprite mode (the only supported mode for now)
  • Configurable styles and options
  • Fast!

Install

npm install --save react-emojione2

Run demo

# clone repo and then
npm install
npm run dev-server
# open http://localhost:8080/

Basic usage

import {emojify} from 'react-emojione';

ReactDOM.render(
    <div>
        {emojify('Easy! :wink: 😸 :D  ^__^')}
    </div>,
    document.body
);

Advanced

import {emojify} from 'react-emojione';

const options = {
    convertShortnames: true,
    convertUnicode: true,
    convertAscii: true,
    styles: {
        backgroundImage: 'url(emojione.sprites.png)',
        width: '64px',
        height: '64px',
        margin: '4px'
    },
    // this click handler will be set on every emoji
    handleClick: event => alert(event.target.title)
};

ReactDOM.render(
    <div>
        {emojify('Easy! :wink: 😸 :D ^__^', options)}
    </div>,
    document.body
);

Output

You can also render to unicode (instead of virtualdom) using the output option

import {emojify} from 'react-emojione';

emojify('Easy! :wink: :D ^__^', {output: 'unicode'});
// Easy! 😉 😃 😄

License

MIT

2.2.18

7 years ago

2.2.17

7 years ago

2.2.16

7 years ago

2.2.15

7 years ago

2.2.14

7 years ago

2.2.13

7 years ago

2.2.12

7 years ago

2.2.11

7 years ago

2.2.10

8 years ago

2.2.9

8 years ago

2.2.8

8 years ago

2.2.7

8 years ago

2.2.6

8 years ago