Skip to content

react-z/react-emojipicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-emojipicker

npm version

react-emojipicker is a simple emoji picker component

Uses emojione for rendering emojis to images.

An Emoji object is returned in the following format from the picker.

{
  image: '<img class="emojione" alt="😀" src="https://cdn.jsdelivr.net/emojione..." />',
  unicode: 😀,
  shortname: ':grinning:'
}

Install

npm install react-emojipicker --save

Usage basic

import Picker from 'react-emojipicker'
import ReactDOM from 'react-dom'
import React, { Component, PropTypes } from 'react'

class TestComponent extends Component {
  logEmoji (emoji) {
    console.log(emoji)
  }

  render () {
    return (
      <div>
        <Picker onEmojiSelected={this.logEmoji.bind(this)} />
      </div>
    )
  }
}

ReactDOM.render(
  <TestComponent />,
  document.getElementById('root')
)

Props

onEmojiSelected (required)

Handler returns the emoji character selected from the emoji picker.

visible

Opacity to show or hide the picker. Defaults to true.

modal

If you want the emoji picker to be a modal. true will set the wrapper as position: absolute. Or false, which is the default will be position: static.

Styles

Uses styled-components 💅 for the base styling.

Development

yarn
yarn dev

Test

yarn test

Build

yarn
yarn build

Publish

npm login
npm version patch
git add -A
git push origin master
npm publish

License

MIT

About

A react emoji picker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published