Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

react-emojify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-emojify

A tiny ES6 library to use emojis in React

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

react-emojione

A tiny ES6 library to use emojis in React

Features

  • 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-emojione

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: '32px',
        height: '32px',
        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
);

License

MIT

Keywords

react

FAQs

Package last updated on 08 Dec 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