New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-emojis-picker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-emojis-picker

A simple emoji picker for React Native and Expo. It's built with TypeScript and uses Reanimated 2 for smooth animations.

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-emojis-picker

It's built with TypeScript and uses Reanimated 2 for smooth animations

light themedark theme

Installation

npm install react-native-emojis-picker

Dependencies

This library needs react-native-reanimated to be installed in your project before you can use it:

npm install react-native-reanimated@3.6.2

Add react-native-reanimated/plugin plugin to your babel.config.js.

  module.exports = {
    presets: [
      ... // don't add it here :)
    ],
    plugins: [
      ...
      'react-native-reanimated/plugin',
    ],
  };

Usage

wrap the whole app in EmojiProvider

import { EmojiProvider } from "react-native-emojis-picker";
export default function App() {
  return <EmojiProvider>//rest your app</EmojiProvider>;
}

simple emoji component

import { Button, StyleSheet, Text, View } from "react-native";
import { useState } from "react";
import { EmojiModal } from "react-native-emojis-picker";

export default function EmojiComponent() {
  const [showModal, setShowModal] = useState(false);
  const [emoji, setEmoji] = useState("");
  return (
    <View style={styles.container}>
      <Text style={{ fontSize: 100 }}>{emoji}</Text>
      <Button
        title="Show Emojis Modal 😁"
        onPress={() => {
          setShowModal(true);
        }}
      />
      {showModal && (
        <EmojiModal
          onPressOutside={() => setShowModal(false)}
          onEmojiSelected={(emoji) => {
            setShowModal(false);
            setEmoji(emoji);
          }}
        />
      )}
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});

now import the component we just created into App.tsx

import { EmojiProvider } from "react-native-emojis-picker";
import EmojiComponent from "./components/emoji";
export default function App() {
  return (
    <EmojiProvider>
      <EmojiComponent />
    </EmojiProvider>
  );
}

EmojiModal Props

PropertyTypeDefaultdescription
intensityBlurnumber20the intensity of the backgroud blur
columnsnumber10number of columns
onEmojiSelectedfunctionundefinedfunction fire when emoji selected and return the selected emoji
onPressOutsidefunctionundefinedfunction fire when the user press outside the modal
position"top" or "bottom" or "center""center"position of the modal
autoFocusSearchbooleanfalseauto focus the search textbox
darkModebooleanfalsetheme of the modal
categoriesKey[]All categoriesonly categories these are shown in the modal such as ( "Smileys & Emotion" "Activities" "Animals & Nature" "Flags" "Food & Drink" "Objects" "People & Body" "Symbols" "Travel & Places")

Author

Majed Al-Otaibi, Majed@skiff.com

License

react-native-emojis-picker is available under the MIT license. See the LICENSE file for more info

Keywords

expo

FAQs

Package last updated on 09 Feb 2024

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