react-emojione
A tiny library to use emojis in React
Features
- Updated to emojione v3.1.2
- Dependency free!
- Can be used as function:
emojify()
or component:<Emojify>
- Converts :shortnames:, unicode and ASCII smileys
- Copy-paste friendly
- Sprite mode (the only supported mode for now)
- Configurable styles and options
- Easy!
Demo
Install
npm install --save react-emojione
Development / Run demo
# clone repo git clone ... # get dependencies yarn # start dev-server yarn start
Basic usage (function)
; ReactDOM;
Basic usage (component)
; ReactDOM;
Advanced usage (function)
; const options = convertShortnames: true convertUnicode: true convertAscii: true style: backgroundImage: 'url("/path/to/your/emojione.sprites.png")' height: 32 margin: 4 // this click handler will be set on every emoji ; ReactDOM;
Advanced usage (component)
Simply pass options as props
; ReactDOM;
Some notes about the <Emojify>
component:
- If it has a single child, it won't be wrapped
- Otherwise it will be wrapped with a
<span>
Output
You can also render to unicode (instead of react elements) using the output
option
; ;// Easy! 😉 😃 😄
License
MIT
Emoji provided free by http://emojione.com