Coder Social home page Coder Social logo

ahmaddehnavi / react-native-emoji-keyboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liangl1412/react-native-emoji-keyboard

0.0 0.0 0.0 4.94 MB

A React Native emoji keyboard/picker component for both Android and ios

License: MIT License

JavaScript 100.00%

react-native-emoji-keyboard's Introduction

React Native Emoji Board

npm version

React Native Emoji Board is a customizable component similar to native keyboard but only with emoji for both iOS and Android. You can use this component as a keyboard input or emoji picker.

Emoji Board

Installation

  1. yarn add react-native-emoji-board
  2. yarn add react-native-vector-icons if you don't have it
  3. yarn add @react-native-community/viewpager if you don't have it

Linking

>= 0.60 Autolinking will just do the job.

< 0.60

react-native link react-native-vector-icons

react-native link @react-native-community/viewpager

Props

Required Props

Prop Description type
onClick Call back function when you clciked on emoji function

Optional Props

Prop Description type default value
showBoard Show or hide Emoji board with animation boolean false
customEmoji See Custom Emoji array []
categories Default full categories from emoji-datasource array See defaultProps.categories
blackList Exclude emojis based on short_name array []
numRows Number of emoji rows to display per slide number 8
numCols Number of emoji columns to display per slide number 5
emojiSize Default emoji size number 24
tabBarPosition Default category nav position string 'bottom'
hideBackSpace Show or hide backspace icon boolean false
categoryDefautColor Default category icon color string '#aaa'
categoryHighlightColor Default category icon highlight color string '#000'
categoryIconSize Default category icon size string 20
containerStyle Main container style, same as Layout Props object {}
tabBarStyle Category bar style, same as Layout Props object {}
labelStyle Category label style, same as Text Props object {}
onRemove Call back function when backspace get clicked function null

If you want to support less category or modify the icon, here is the categories props:

Prop Description type
name Category name string
iconType Only support MaterialCommunityIcons and FontAwesome, you can use defined iconType string
icon Icon/Font name, you can find list from here string

Example Code

import EmojiBoard from 'react-native-emoji-board'

const App: () => React$Node = () => {
    const [show, setShow] = useState(false);
    const onClick = emoji => {
        console.log(emoji);
    };

    return (
        <>
            <StatusBar barStyle="dark-content" />
            <TouchableOpacity onPress={() => setShow(!show)}>
                <Text>click here</Text>
            </TouchableOpacity>
            <EmojiBoard showBoard={show} onClick={onClick} />
        </>
    );
};

Custom Emojis

Example:

const customEmojis = [
    {
        code: '๐ŸŽ…๐Ÿผ',
        img: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/160/apple/237/father-christmas_1f385.png',
        name: 'santa',
        category: 'Smileys & Emotion',
        sort_order: 1,
        skins: [
            {
                img: 'https://github.githubassets.com/images/icons/emoji/octocat.png',
                name: 'octocat',
            }
        ]
        
    }
]

Prop Description type
code Native emoji(optional, fallback to image) string
img If you would like to have custom image instead, don't set code string
name Emoji/image name string
category Emoji category, need to match with what you have in categories props string
sort_order Sort order number
skins Skin support, same props with above array

Credit

Inspired by xiewang/react-native-emoticons

react-native-emoji-keyboard's People

Contributors

ahmaddehnavi avatar dependabot[bot] avatar emersonhsieh avatar liangl1412 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.