• This repository has been archived on 31/Jan/2023
  • Stars
    star
    261
  • Rank 156,630 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A react emoji picker for use with emojione

npm version CircleCI

Emoji Picker

A friendly Emoji picker for Emojione written as a React component. It looks a little something like this, but is easily customized:

Emoji Picker

Installation

Install with your favorite package manager:

npm i emojione-picker --save
yarn add emojione-picker

Webpack

The emoji strategy is read from a json file, as such you'll need to make sure that the json-loader is included in your loaders configuration, something like:

loaders: [
    {
        test: /\.json$/,
        loader: "json-loader"
    }
]

Usage

The module includes a transpiled version of the picker so you don't need to run it through a JSX pipeline. Simply require the module like any other.

var EmojiPicker = require('emojione-picker');

<EmojiPicker onChange={function(data){
  console.log("Emoji chosen", data);
}} />

The module also includes CSS at css/picker.css which you can copy and edit or ideally reference directly from within the node_modules directory. Let me know if you're using this in production - i'd love to see it in action!

Filtering

You can manually pass in a search term as a component prop to filter which emoji's are displayed by default, for example:

<EmojiPicker search="smile" />

Or allow the user to search by passing a boolean true, this will enable a search input within the picker:

<EmojiPicker search={true} />

Emoji Picker with Search

Customize Categories

You can easily customize the category icons by passing in alternatives to the component constructor. The emoji strings come from the shortname value in strategy.js.

var categories = {
  people: {
    title: 'People',
    emoji: 'smile'
  },
  nature: {
    title: 'Nature',
    emoji: 'mouse'
  },
  food: {
    title: 'Food & Drink',
    emoji: 'burger'
  }
}

<EmojiPicker categories={categories} />

Spritesheets

You can make the picker use a spritesheet, however this requires a little extra work. Emojione settings can be passed into the Picker component as below. Follow these instructions to load the correct spritesheets into your page.

var settings = {
  imageType: 'png',
  sprites: true
};
<EmojiPicker categories={categories} emojione={settings} />

Content Security Policy

The picker uses react-virtualized, which creates an inlined style. Give the picker a nonce and set Content-Security-Policy field in HTTP header accordingly if your CSP requires this.

<EmojiPicker nonce={NONCE_GENERATED_WHEN_TRANSMITTING} />
Content-Security-Policy: style-src: 'self' 'nonce-NONCE_GENERATED_WHEN_TRANSMITTING'

Development

yarn install
yarn start

Open http://localhost:8080/examples in a browser to see a preview of the picker.

License

MIT License

Emojione is used under the Creative Commons License (CC-BY 4.0) - If you use this component you should also include attribute to Emojione somewhere within your website or application to satisfy the terms of the license.

More Repositories

1

tinycon

A small library for manipulating the favicon, in particular adding alert bubbles and changing images.
JavaScript
5,110
star
2

crumble

Crumble makes it easy to create feature tours in your website or app.
JavaScript
659
star
3

react-emoji-render

Normalize and render emoji's the way your users expect.
JavaScript
337
star
4

electron-lets-move

Automatically move Electron apps to the Applications directory
JavaScript
178
star
5

fastimage

FastImage finds the dimensions or filetype of an image at a url by fetching the least data possible
PHP
163
star
6

HackerNew

The best Chrome extension to make Hacker News quicker and more useful.
JavaScript
125
star
7

fontselect-jquery-plugin

A font selector for the Google Web Fonts api
JavaScript
102
star
8

navigate-jquery-plugin

Allows any group of dom elements to be navigated with the keyboard arrows
JavaScript
16
star
9

tinyrange-jquery-plugin

TinyRange is a small jquery slider plugin that augments the html5 range element
JavaScript
15
star
10

promise-pool

A flexible pool of promises that can be awaited and executed at a chosen level of concurrency
JavaScript
10
star
11

Zap

Zap! is an audio manager for html 5 applications with a focus on real time and interactive applications such as games.
JavaScript
7
star
12

distribute-jquery-plugin

Ensures child elements are horizontally spaced evenly in fluid layouts
JavaScript
6
star
13

mime-names

Media Type Names Database
JavaScript
4
star
14

Testing-Repo

Testing Repository.
JavaScript
4
star
15

annotatey

Draw annotations on any website and save to Dropbox. Hack project for TechCrunch Disrupt 2013
JavaScript
3
star
16

dotfiles

My dotfiles. It's public because it's free, not because you should care.
Ruby
3
star
17

sheffield-js-photobooth

Sample application built for talk on node-webkit at Sheffield.js
JavaScript
2
star
18

personal-api

WIP, framework for anyone to easily build a personal API.
JavaScript
1
star
19

felony

WIP. HTML5 top-down game using box2d
JavaScript
1
star
20

electronguides.github.io

A collection of guides for those building Electron apps
1
star
21

macflix

Mac desktop wrapper for Netflix with all the goodies you'd expect
JavaScript
1
star
22

pulse-jquery-plugin

Animate the DOM using a mediaStream
JavaScript
1
star
23

vagrant-heroku

Ruby
1
star
24

doorman

This script answers my front door
JavaScript
1
star
25

easy-peer-connection

A wrapper library to make PeerConnections in the web browser easy
1
star
26

tommoor.github.io

Personal website
HTML
1
star
27

quantified-chrome

Track your browsing habits
CSS
1
star
28

filecop

Checks filenames against a library of filename rules to find sensitive files
Ruby
1
star
29

forest

Fast, detailed event logging for lithium PHP
1
star