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! 💖

  • 1.0.0-alpha.0
  • alpha
  • 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
hideHeaderbooleanfalsenoHide category names
allowMultipleSelectionsbooleanfalsenoAllow selecting multiple emoji without dismissing keyboard
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
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
onRequestClosefunctionundefinednoHandle onRequestClose in modal
disableSafeAreabooleanfalsenoDisable safe area inside modal
themeThemedefaultThemenoCustom colors theme
stylesStylesdefaultStylesnoCustom styles

📊 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.

🎨 Theme

You can override color palette with custom colors using theme prop.

const defaultTheme: Theme = {
  backdrop: '#00000055',
  knob: '#ffffff',
  container: '#ffffff',
  header: '#00000099',
  category: {
    icon: '#000000',
    iconActive: '#005b96',
    container: '#e3dbcd',
    containerActive: '#ffffff',
  },
  search: {
    text: '#000000cc',
    placeholder: '#00000055',
    icon: '#00000055',
    background: '#00000011',
  },
}

📏 Styles

You can also override styles to almost every element using styles prop in the following format.

type Styles = {
  container: ViewStyle
  header: TextStyle
  knob: ViewStyle
  category: {
    container: ViewStyle
    icon: TextStyle
  }
  searchBar: {
    container: ViewStyle
    text: TextStyle
  }
}

🇺🇸 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 🇩🇪
  • pt - Portuguese 🇧🇷
  • ua - Ukrainian 🇺🇦
  • ru - Russian 🇷🇺
  • vi - Vietnamese 🇻🇳

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

⚖️ License

MIT

📝 Contribute

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

Keywords

FAQs

Package last updated on 25 Aug 2022

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