Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rn-emoji-keyboard

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-emoji-keyboard

Super performant, lightweight, fully customizable emoji picker. Designated to be user and developer friendly! 💖

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.2K
decreased by-14.93%
Maintainers
2
Weekly downloads
 
Created
Source

🚀 rn-emoji-keyboard

A lightweight, fully customizable emoji picker, written as React Native component (without native elements). Designated to be user and developer friendly! 💖

Preview

🪄 Installation

yarn add rn-emoji-keyboard

or

npm install rn-emoji-keyboard

⚡️ Usage

import EmojiPicker from 'rn-emoji-keyboard';

export default function App() {
  const [isOpen, setIsOpen] = React.useState<boolean>(false);

  const handlePick = (emojiObject: EmojiType) => {
    console.log(emojiObject);
    /* example emojiObject = {
        "emoji": "❤️",
        "name": "red heart",
        "slug": "red_heart",
        "unicode_version": "0.6",
      }
    */
  };

  return (
    <EmojiPicker
      onEmojiSelected={handlePick}
      open={isOpen}
      onClose={() => setIsOpen(false)} />
  )
}

⚙️ Accepted props (current implemented)

NameTypeDefault ValueRequiredDescription
onEmojiSelectedfunctionundefinedyesCallback on emoji selected
openbooleanfalseyesOpens modal picker
onClosefunctionundefinedyesRequest close modal runs when onEmojiSelected or backdrop pressed
emojiSizenumber28noCustom emoji size
enableRecentlyUsedbooleanfalsenoEnable recently used emojis in categories
categoryPosition'floating' | 'top' | 'bottom''floating'noSpecify category container position
enableSearchBarbooleanfalsenoEnable search bar
closeSearchColorstring"#00000055"noChange button (cross) color for close/cancel search
searchBarStylesViewStyle{}noOverride search bar container styles
searchBarTextStylesViewStyle{}noOverride search bar text styles
searchBarPlaceholderColorstring"#00000055"noOverride search bar placeholder color
headerStylesTextStyle{}noOverride category name styles
knobStylesViewStyle{}noOverride knob styles
containerStylesViewStyle{}noOverride container styles
hideHeaderbooleanfalsenoHide category names
expandablebooleantruenoShow knob and enable expand on swipe up
defaultHeightnumber | string"40%"noSpecify collapsed container height (number is points, string is a percentage of the screen height)
expandedHeightnumber | string"80%"noSpecify expanded container height (number is points, string is a percentage of the screen height) works only if expandable is true
backdropColorstring"#00000055"noChange backdrop color and alpha
categoryColorstring"#000000"noChange category item color
activeCategoryColorstring"#005b96"noChange active category item color
categoryContainerColorstring"#e3dbcd"noChange category container color
activeCategoryContainerColorstring"#ffffff"noChange selected category container color
onCategoryChangeFailedfunctionwarn(info)noCallback on category change failed (info: {index, highestMeasuredFrameIndex, averageItemLength})
translationCategoryTranslationennoTranslation object see translation section
disabledCategoriesCategoryTypes[][]noHide categories by passing their slugs
categoryOrderCategoryTypes[][]noSet category sequence

📊 Comparison

comparison table

🖼 Usage as static

import { EmojiKeyboard } from 'rn-emoji-keyboard';

// ...

<EmojiKeyboard onEmojiSelected={handlePick} />

Example about serving as static keyboard you can find here.

🇺🇸 Internationalization

Pre-defined

Due to the limited translation possibilities, we only provide a few pre-defined translations into the following languages:

  • en - English 🇺🇸
  • pl - Polish 🇵🇱
  • fr - French 🇫🇷
  • it - Italian 🇮🇹
  • ko - Korean 🇰🇷
  • id - Indonesian 🇲🇨
  • es - Spanish 🇪🇸
  • de - German 🇩🇪

First import lang and use it as translation prop.

import { pl } from 'rn-emoji-keyboard';

// ...

translation={pl}

🏁 Own

There is possibility to pass own translation to library with the prop called translation like this

translation={{
  smileys_emotion: 'Smileys & Emotion',
  people_body: 'People & Body',
  animals_nature: 'Animals & Nature',
  food_drink: 'Food & Drink',
  travel_places: 'Travel & Places',
  activities: 'Activities',
  objects: 'Objects',
  symbols: 'Symbols',
  flags: 'Flags',
}}

If you have written a translation into your language, we strongly encourage you to create a Pull Request and add your language to the package, following the example of other langs.

🎉 Examples

You can clone the repo and run yarn example ios or yarn example android to preview app with this examples.

Basic

Preview

Dark

Preview

Translated

Preview

Disabled Categories

Preview

Static Modal (without knob)

Preview

Static

Preview

Recently used

Preview

Categories Top

Preview

Categories Bottom

Preview

Preview

📈 Future plans

  • Skin tone palette selector.
  • Write native module to display forbidden emojis on android.

⚖️ License

MIT

📝 Contribute

If you want to contribute read the CONTRIBUTING.md guide.

Keywords

FAQs

Package last updated on 18 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc