All Projects β†’ ealush β†’ Emoji Picker React

ealush / Emoji Picker React

Licence: unlicense
React Emoji Picker

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Emoji Picker React

Rofimoji
An emoji and character picker for rofi 😁
Stars: ✭ 319 (+44.34%)
Mutual labels:  picker, emoji-picker
AllGithubEmojis
A list of all supported github emojis updated weekly. https://jzeferino.github.io/AllGithubEmojis/
Stars: ✭ 82 (-62.9%)
Mutual labels:  emoji-picker, emojis
Awesome Emoji Picker
Add-on/WebExtension that provides a modern emoji picker that you can use to find and copy/insert emoji into the active web page.
Stars: ✭ 54 (-75.57%)
Mutual labels:  emoji-picker, emojis
mr-emoji
Lightweight emoji picker like SLACK
Stars: ✭ 23 (-89.59%)
Mutual labels:  picker, emoji-picker
Supernova Emoji
library to implement and render emojis For Android
Stars: ✭ 334 (+51.13%)
Mutual labels:  emoji-picker, emojis
Emoji Mart
One component to pick them all πŸ‘ŠπŸΌ
Stars: ✭ 4,687 (+2020.81%)
Mutual labels:  picker, emoji-picker
Vue Emoji Picker
Very simple, yet powerful, vue emoji picker πŸŽ‰πŸ”₯πŸš€
Stars: ✭ 218 (-1.36%)
Mutual labels:  emoji-picker, emojis
React Native Modal Datetime Picker
A React-Native datetime-picker for Android and iOS
Stars: ✭ 2,412 (+991.4%)
Mutual labels:  picker
Lightpick
(deprecated) Check out the new date picker Litepicker
Stars: ✭ 204 (-7.69%)
Mutual labels:  picker
Jquery.redirect
jQuery Redirect Plugin
Stars: ✭ 182 (-17.65%)
Mutual labels:  cdn
React Mobile Picker
An iOS like select box component for React
Stars: ✭ 180 (-18.55%)
Mutual labels:  picker
Vue Smooth Picker
πŸ„πŸΌ A SmoothPicker for Vue 2 (like native datetime picker of iOS)
Stars: ✭ 188 (-14.93%)
Mutual labels:  picker
Efcolorpicker
A lightweight color picker in Swift.
Stars: ✭ 205 (-7.24%)
Mutual labels:  picker
Simplenumberpicker
A customisable decimal and hexadecimal material picker view for Android.
Stars: ✭ 185 (-16.29%)
Mutual labels:  picker
Emojicode
πŸ˜€πŸ˜œπŸ”‚ World’s only programming language that’s bursting with emojis
Stars: ✭ 2,561 (+1058.82%)
Mutual labels:  emojis
Color Picker
A simple color picker application written in pure JavaScript, for modern browsers.
Stars: ✭ 180 (-18.55%)
Mutual labels:  picker
Facebookimagepicker
FacebookImagePicker is Facebook album photo picker written in Swift.
Stars: ✭ 220 (-0.45%)
Mutual labels:  picker
File Picker
The Kloudless File Picker is a file chooser and uploader for apps that integrates with 20+ cloud storage services with a few lines of code
Stars: ✭ 208 (-5.88%)
Mutual labels:  picker
Pipes Rs
An over-engineered rewrite of pipes.sh in Rust
Stars: ✭ 189 (-14.48%)
Mutual labels:  emojis
Cdn
CDN is a Just-in-time asset manipulation and delivery application, providing a complete content distribution/delivery solution
Stars: ✭ 192 (-13.12%)
Mutual labels:  cdn

emoji-picker-react

V3

Live Demo

Preview

What you need to know before installing?

  • Version 3 uses React hooks, which means you need to use React 16.8 or higher.
  • Unlike previous versions, this version uses Apple emojis.
  • V3 does not support SSR. The assumption is that you mount it only after user interaction in the browser. SSR support may be added in the future.

Installation

npm i emoji-picker-react

Or

yarn add emoji-picker-react

New v3 features

  • Larger emoji library.
  • Apple emojis instead of emojione.
  • Recently used emojis support.
  • Faster load time, improved performance.
  • Ability to set default skin tone.

Usage

Emoji-picker-react comes ready to use out of the box, zero conf needed. The only thing you need to do is add your own emoji click callback.

import React, { useState } from 'react';
import Picker from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      {chosenEmoji ? (
        <span>You chose: {chosenEmoji.emoji}</span>
      ) : (
        <span>No emoji Chosen</span>
      )}
      <Picker onEmojiClick={onEmojiClick} />
    </div>
  );
};

Accepted props

Name Type Default Value Required? Description
onEmojiClick Function undefined Yes Callback to run when clicking an emoji.
preload Boolean false No Indicates whether all emojis images, should be preloaded, or only when showing each category.
skinTone string neutral No Decides the default skit tone for supported emojis.
disableAutoFocus boolean false No Disables autofocus of the search bar. Useful for safari-iphone devices which zoom in to focused inputs.
disableSearchBar boolean false No Disables the search bar and the skin tone picker altogether.
disableSkinTonePicker boolean false No Disables the skin tone picker.
pickerStyle string undefined No Overrides style of the component.
groupNames Object undefined No Specifies alternative category names to use. See Internationalization section.
groupVisibility Object undefined No Specifies group names to be disabled.
native Boolean false No Loads system emojis instead of Apple Emoji pngs

onEmojiClick Arguments

onEmojiClick is a regular click handler for any of the emojis in the app. It takes two arguments:

  1. The click event.
  2. An emoji object, which contains the following:
    • emoji: The emoji symbol. May vary across OSs, in some it may not be visible to you.
    • unified: The actual emoji unicode.
    • activeSkinTone: The currently selected skin tone, regardless if the current emoji has one or not.
    • originalUnified: If the currently selected emoji has a skin tone modifier, originalUnified will hold the "neutral" code.
    • names: An array of one or more descriptive names for the emoji.

Setting a default skin tone modifier

You may choose an alternative skin tone as the default skin tone to show for supported emojis (such as the 🀘 rocker hand emoji). Emoji-picker-react exports descriptive names for all skin variations so you may use them when setting your variations.

The following are exported:

  • βœ‹ SKIN_TONE_NEUTRAL
  • βœ‹πŸ» SKIN_TONE_LIGHT
  • βœ‹πŸΌ SKIN_TONE_MEDIUM_LIGHT
  • βœ‹πŸ½ SKIN_TONE_MEDIUM
  • βœ‹πŸΎ SKIN_TONE_MEDIUM_DARK
  • βœ‹πŸΏ SKIN_TONE_DARK

Use them like this:

import React, { useState } from 'react';
import Picker, { SKIN_TONE_MEDIUM_DARK } from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      <Picker onEmojiClick={onEmojiClick} skinTone={SKIN_TONE_MEDIUM_DARK} />
    </div>
  );
};

Customize Styling

You can override the style of emoji-picker-react with pickerStyle props.

import React, { useState } from 'react';
import Picker from 'emoji-picker-react';

const App = () => {
  const [chosenEmoji, setChosenEmoji] = useState(null);

  const onEmojiClick = (event, emojiObject) => {
    setChosenEmoji(emojiObject);
  };

  return (
    <div>
      <Picker onEmojiClick={onEmojiClick} pickerStyle={{ width: '100%' }} />
    </div>
  );
};

Internationalization

The emoji names cannot be translated as they come from an external library, but it is possible to rename the categories. To rename the categories, pass a prop called groupNames which contains an object of group keys and their names as strings. For example:

<Picker
  groupNames={{
    smileys_people: 'yellow faces',
    animals_nature: 'cute dogs and also trees',
    food_drink: 'milkshakes and more',
    travel_places: 'I love trains',
    activities: 'lets play a game',
    objects: 'stuff',
    symbols: 'more stuff',
    flags: 'fun with flags',
    recently_used: 'did I really use those?!',
  }}
/>

The complete list of keys is:

  • smileys_people
  • animals_nature
  • food_drink
  • travel_places
  • activities
  • objects
  • symbols
  • flags
  • recently_used

Disabling categories

It is possible to disable certain categories by setting the groupVisibility prop. The groupVisibility prop takes an object of group names, and a boolean indicating whether they should be shown or not. For example, if you'd like to disable the flags category, set it to false like this:

<Picker
  groupVisibility={{
    flags: false,
  }}
/>

The complete list of keys is:

  • smileys_people
  • animals_nature
  • food_drink
  • travel_places
  • activities
  • objects
  • symbols
  • flags
  • recently_used

UI Customizations

In general, UI customizations can be done directly via CSS. Descriptive classnames were added in order for you to be able to easily target whatever it is you want to change, and the markup is guaranteed to stay unchanged until the next major version (4).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].