Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yatharthx/react-emoj
Easy-use emoji component for React 📦
https://github.com/yatharthx/react-emoj
emoji emoji-component emoticons react
Last synced: 21 days ago
JSON representation
Easy-use emoji component for React 📦
- Host: GitHub
- URL: https://github.com/yatharthx/react-emoj
- Owner: yatharthx
- License: mit
- Created: 2017-01-22T10:17:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-08T04:31:23.000Z (almost 8 years ago)
- Last Synced: 2024-11-20T21:04:46.529Z (about 1 month ago)
- Topics: emoji, emoji-component, emoticons, react
- Language: JavaScript
- Size: 101 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-emoj [![Build Status](https://travis-ci.org/yatharthk/react-emoj.svg?branch=master)](https://travis-ci.org/yatharthk/react-emoj) [![Coverage Status](https://coveralls.io/repos/github/yatharthk/react-emoj/badge.svg?branch=master)](https://coveralls.io/github/yatharthk/react-emoj?branch=master)
Easy-use emoji component for React
### Installation
```
npm install --save react-emoj
```### Usage
`react-emoj` serves a minimal and convenient API for use.#### Module exports
- `ReactEmoji` as React Component (default export)
- `Emoji` as an emoji utility that serves internally as a helper to `ReactEmoji` (exports.Emoji)You can import them as:
`import ReactEmoji, { Emoji } from 'react-emoj'`
#### API
##### `ReactEmoji`
*ReactEmoji* shall be rendered with `props`:###### emoji
Type: `Array(string)`
Example:
```js```
Useful when all you need to render is a list of emoticons.###### style
Type: `Object`
Example:
```js```
Useful when you need to set color/font size of text or emoticons.*ReactEmoji* can be used for displaying text that includes emoji by passing the text as child to the component. The text must always be of type `string`. The emoticons to be displayed shall be wrapped in colons in format `:emoji_code:`.
Example:
```jsI :hearts: coffee
```
##### `Emoji`
###### .emoji
Serves you a `JSON` object of emoji.###### .emojify(text)
Type: `text: string`
Emoji Format: `:emoji_code:`
Example:
```js
Emoji.emojify('I love :coffee:') // I love ☕️
```
Useful when all you need is an `emojified` text, not a rendered component.###### .fromArray(emojiList)
Type: `emojiList: [string] i.e an Array of string`
Emoji Format: `emoji_code`
Example:
```js
Emoji.fromArray(['coffee', 'sunglasses']) // ☕️😎
```
Useful when all you need is an emoji list, not a rendered component.### License
MIT © Yatharth Khatri