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.2.4
  • 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
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
disabledCategoryCategoryTypes[][]noHide categories by passing their slugs

πŸ“Š 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 πŸ‡΅πŸ‡±

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

DisabledCategories

Preview

StaticModal (without knob)

Preview

Static

Preview

πŸ“ˆ Future plans

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

βš–οΈ License

MIT

Keywords

FAQs

Package last updated on 27 Jul 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