Popularity
2.3
Stable
Activity
0.0
Stable
118
2
13
Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
react-emoji-react alternatives and similar libraries
Based on the "Icons" category.
Alternatively, view react-emoji-react alternatives based on common mentions on social networks and blogs.
-
react-icomoon
It makes it very simple to use SVG icons in your React and React-Native projects. -
react-open-doodles
A Free Set of Sketchy Illustrations provided by opendoodles -
tabler-icons-react
A set of over 450 free MIT-licensed high-quality SVG icons.
A Non-Cloud Alternative to Google Forms that has it all.
SurveyJS JavaScript libraries allow you to easily set up a robust form management system fully integrated into your IT infrastructure where users can create and edit multiple dynamic JSON-based forms in a no-code form builder. Learn more now.
Promo
surveyjs.io
Do you think we are missing an alternative of react-emoji-react or a related project?
README
React Emoji React
A clone (eventually) of slack emoji reactions as a react component
Click here for a demo.
Install
npm install react-emoji-react --save
Use
import EmojiReact from 'react-emoji-react';
import React, { Component } from 'react';
import { render } from 'react-dom';
const emojis = [
{
name: 'rage',
count: 2
},
{
name: 'blush',
count: 1
},
{
name: 100,
count: 3
},
{
name: 'grinning',
count: 2
}
];
class ReactingComponent extends Component {
constructor() {
super();
this.state = {
emojis
};
}
onReaction(name) {
const emojis = this.state.emojis.map(emoji => {
if (emoji.name === name) {
emoji.count += 1;
}
return emoji;
});
this.setState({ emojis });
}
onEmojiClick(name) {
console.log(name);
const emojis = this.state.emojis.concat([{name, count: 1}]);
this.setState({ emojis });
}
render() {
return (
<EmojiReact
reactions={this.state.emojis}
onReaction={(name) => this.onReaction(name)}
onEmojiClick={(name) => this.onEmojiClick(name)}
/>
);
}
}
render(<ReactingComponent />, document.getElementById('app'));
Args
reactions
- an array of current emoji reactions, reactions are objects containing name and count.onReaction
- fired when a current reaction is clicked.onEmojiClick
- fired when a new emoji is selected.